From 0e7d871210d98a631a84dcc593b1c2c1d807fd2a Mon Sep 17 00:00:00 2001 From: Drew Risinger Date: Wed, 4 Nov 2020 13:03:00 -0500 Subject: [PATCH] testing: timeout long tests https://github.com/NixOS/nixpkgs/issues/102724 --- pkgs/development/python-modules/qiskit-aer/default.nix | 6 ++++++ pkgs/development/python-modules/qiskit-aqua/default.nix | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/qiskit-aer/default.nix b/pkgs/development/python-modules/qiskit-aer/default.nix index d92e759086de..57d89b557111 100644 --- a/pkgs/development/python-modules/qiskit-aer/default.nix +++ b/pkgs/development/python-modules/qiskit-aer/default.nix @@ -21,6 +21,7 @@ , pytestCheckHook , ddt , fixtures +, pytest-timeout , qiskit-terra }: @@ -81,8 +82,13 @@ buildPythonPackage rec { pytestCheckHook ddt fixtures + pytest-timeout qiskit-terra ]; + pytestFlagsArray = [ + "--timeout=30" + "--durations=10" + ]; preCheck = '' # Tests include a compiled "circuit" which is auto-built in $HOME diff --git a/pkgs/development/python-modules/qiskit-aqua/default.nix b/pkgs/development/python-modules/qiskit-aqua/default.nix index f3918cddd3b2..11274c525f09 100644 --- a/pkgs/development/python-modules/qiskit-aqua/default.nix +++ b/pkgs/development/python-modules/qiskit-aqua/default.nix @@ -28,6 +28,7 @@ # Check Inputs , ddt , pytestCheckHook +, pytest-timeout , qiskit-aer }: @@ -100,6 +101,7 @@ buildPythonPackage rec { checkInputs = [ pytestCheckHook ddt + pytest-timeout qiskit-aer ]; pythonImportsCheck = [ @@ -110,7 +112,10 @@ buildPythonPackage rec { "qiskit.ml" "qiskit.optimization" ]; - pytestFlagsArray = lib.optionals (!withPyscf) [ + pytestFlagsArray = [ + "--timeout=30" + "--durations=10" + ] ++ lib.optionals (!withPyscf) [ "--ignore=test/chemistry/test_qeom_ee.py" "--ignore=test/chemistry/test_qeom_vqe.py" "--ignore=test/chemistry/test_vqe_uccsd_adapt.py"