From: Scott Worley Date: Mon, 19 Jul 2021 21:37:30 +0000 (-0700) Subject: Go faster: Run the initial `nixos-rebuild switch`es concurrently X-Git-Url: http://git.scottworley.com/trustix-integration-tests/commitdiff_plain/6046efab541cdb8ef66d9adfae0614434e550d2c?ds=sidebyside;hp=c5557e80db6b143ff7f6bff308398ff526b2a908 Go faster: Run the initial `nixos-rebuild switch`es concurrently --- diff --git a/checks/one-publisher.nix b/checks/one-publisher.nix index b661624..8fe584e 100644 --- a/checks/one-publisher.nix +++ b/checks/one-publisher.nix @@ -154,11 +154,27 @@ in nixosTest { }; testScript = '' from os import getenv + from threading import Thread alisha.wait_for_file("/keys/trustix-pub") alisha.copy_from_vm("/keys/trustix-pub") clint.copy_from_host(getenv("out") + "/trustix-pub", "/keys/alisha-signing-pub") + clint.wait_for_file("/keys/cache-priv-key.pem") + clint_thread = Thread( + target=lambda: clint.succeed( + "${ + mkConfig { + config = clientConfig; + trustixPubKeyPath = "/keys/alisha-signing-pub"; + binaryCachePubKeyPath = "/keys/cache-priv-key.pem"; + } + }", + "nixos-rebuild switch --show-trace", + ) + ) + clint_thread.start() + alisha.succeed( "${ mkConfig { @@ -170,17 +186,7 @@ in nixosTest { ) alisha.succeed("nix-build '' -A hello") - clint.wait_for_file("/keys/cache-priv-key.pem") - clint.succeed( - "${ - mkConfig { - config = clientConfig; - trustixPubKeyPath = "/keys/alisha-signing-pub"; - binaryCachePubKeyPath = "/keys/cache-priv-key.pem"; - } - }", - "nixos-rebuild switch --show-trace", - ) + clint_thread.join() clint.succeed("nix-build '' -A hello") clint.fail("grep hello /var/log/local-builds") '';