From e87d2b4ecd85513e2d3835f8b431bff5d8a74c57 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 24 Jun 2020 22:28:16 +0800 Subject: [PATCH] windows: add back test timeout --- artiq-fast/windows/run-test.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/artiq-fast/windows/run-test.nix b/artiq-fast/windows/run-test.nix index 369af35..767bceb 100644 --- a/artiq-fast/windows/run-test.nix +++ b/artiq-fast/windows/run-test.nix @@ -1,4 +1,4 @@ -{ pkgs, artiqpkgs, testCommand }: +{ pkgs, artiqpkgs, testCommand, testTimeout ? 600 }: let condaEnv = "artiq-env"; @@ -45,8 +45,14 @@ in ${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda index fake-channel" ${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda create -n ${condaEnv} --offline" - ${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate ${condaEnv} && conda install -y -c file:///C:/users/wfvm/fake-channel --offline artiq" - #${pkgs.sshpass}/bin/sshpass -p1234 -- ${pkgs.openssh}/bin/ssh -p 2022 wfvm@localhost -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null + ${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate ${condaEnv} && conda install -y -c file:///C:/users/wfvm/fake-channel --offline artiq"\ + + # Schedule a timed shutdown against hanging test runs + ${wfvm.utils.win-exec}/bin/win-exec "shutdown -s -t ${toString testTimeout}" + ${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate ${condaEnv} && ${testCommand}" + + # Abort timeouted shutdown + ${wfvm.utils.win-exec}/bin/win-exec "shutdown -a" ''; }