Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 493DAC433EF for ; Sun, 19 Sep 2021 21:15:09 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 51751610A8 for ; Sun, 19 Sep 2021 21:15:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 51751610A8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 78A9B82039; Sun, 19 Sep 2021 23:15:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="mUELDebG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BBE3383230; Sun, 19 Sep 2021 23:15:02 +0200 (CEST) Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EE65181BC8 for ; Sun, 19 Sep 2021 23:14:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-ot1-x332.google.com with SMTP id i8-20020a056830402800b0051afc3e373aso20901709ots.5 for ; Sun, 19 Sep 2021 14:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FWVSdef0rQ2Bj/m752gt0yppI2/T4kumI+tyOgNNjPs=; b=mUELDebGuaY6GySRiStSfBKjcozqJnT29VmXmp6gaWpj7yqM049VGJEON+rHuxvse3 AyHdmgcKw0es8w5+m7OsGWkthGd+HPYB9Js4ue8CXjcOCjLGG5ttv1iMvqSlKcKFzsaP +/Eqxc0w6Q8vpxow2IIO1GKmQzc5rj10m3oAY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FWVSdef0rQ2Bj/m752gt0yppI2/T4kumI+tyOgNNjPs=; b=3UrkNwHWkAX8gHOKJdmZgMWVGhWDbj/HJeeYP3v3h+wX4unJ2c35HrVp1m3zJCbicz ga8tabaWBU6CpS0nh9gwcUzzLUu1que6WbkmTwTDlUzuZ/6RS2BV8XpWRzqyIkn5fjR8 2an73uDj6PKMDi/N4xAiF5zhjJTF2+nqx9afpzlD4d+lYaM1uLFIPIOPdxfGsutUWa/N Ucf6iH0mjAs0LVN3LUlDY451aAqsUL4ydGgyufKUuZdlGNsdet04qKN+mKCWrH4hp7p7 IwLmnrPqLwfKqoCaxdawsKFpmWO6V2ZsbobNSXe1tWHwx4DiD4+wEixNnWytQvrBpRQW Ry8g== X-Gm-Message-State: AOAM5308gRexv+hSVYjWlGDmhte1jnDtYlaVnvmgd0lwuyVwm79iqVXJ s6Tsfi2Gv4VEIYm9suyjBQJ/aaYyfHaTRg== X-Google-Smtp-Source: ABdhPJwLazfuESxJj6756atIA8C/R/8ihP6NqmhnbeB699SELw7Y+lFwcNoyMyEEbQ6Gub0X73Ztpw== X-Received: by 2002:a05:6830:83a:: with SMTP id t26mr15798525ots.262.1632086094354; Sun, 19 Sep 2021 14:14:54 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id b11sm3082118ooi.0.2021.09.19.14.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Sep 2021 14:14:53 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Tom Rini , Stephen Warren , Stephen Warren , Simon Glass Subject: [RESEND PATCH v2 0/4] test: Try to deal with some co-dependent tests Date: Sun, 19 Sep 2021 15:14:47 -0600 Message-Id: <20210919211451.3825645-1-sjg@chromium.org> X-Mailer: git-send-email 2.33.0.464.g1972c5931b-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Tests are supposed to be independent. With driver model tests, the environment is reset before each test, which ensures that. With Python tests there is no reset of the board between tests, since we want to run all the tests as quickly as possible and without needing the external scripts running constantly. In principle the Python tests can be independent if they each put the world back the way they found it, but it turns out that some are not. This means that some tests cannot be run unless another test is run first. It also means that tests cannot be run in parallel, e.g. on sandbox. This series fixes some of them. Those that remain: test_gpt_swap_partitions - not sure? test_pinmux_status - not sure? test_sqfs_load - cannot be run more than once! test_bind_unbind_with_uclass - relies on previous test The last one would be much better done as a C test, so it doesn't have to deal with the changing driver tree. There isn't a lot of value in running the test on a real board, since sandbox should find any bugs in driver model or the 'bind' command. If the above can be resolved we can enable parallel tests. On my test machine (32 threads) it reduces the time from 38 seconds to 7.5s To use this feature, see the documentaiton added, or: pip3 install pytest-xdist test/py/test.py -B sandbox --build-dir /tmp/xx -q -k 'not slow' -n32 Changes in v2: - Add documentation for how to run parallel tests Simon Glass (4): test: Allow vboot tests to run in parallel test: Allow hush tests to run in parallel test: Allow tpm2 tests to run in parallel doc: test: Explain how to run pytests in parallel doc/develop/py_testing.rst | 30 +++++++++++++++++ test/py/tests/test_hush_if_test.py | 20 ++++-------- test/py/tests/test_tpm2.py | 52 ++++++++++++++++++++++++++---- test/py/tests/test_vboot.py | 29 +++++++++-------- 4 files changed, 98 insertions(+), 33 deletions(-) -- 2.33.0.464.g1972c5931b-goog