]> git.notmuchmail.org Git - notmuch/commitdiff
tests: make timeout configurable with NOTMUCH_TEST_TIMEOUT (default: 2m)
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 20 May 2019 17:20:56 +0000 (13:20 -0400)
committerDavid Bremner <david@tethera.net>
Mon, 20 May 2019 17:48:43 +0000 (14:48 -0300)
The current 2 minute timeout is reasonable, but to exercise the test
suite or induce timeout failures, we might want to make it shorter.
This makes it configurable so you can run (for example):

    make check NOTMUCH_TEST_TIMEOUT=10s

We stick with the default of 2m.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
test/notmuch-test

index bd3e080af01e47218e1d804f093cbd414b0d12e5..dbca39ca935633feb0a7af28a0dae03384046939 100755 (executable)
@@ -32,8 +32,9 @@ rm -rf $NOTMUCH_BUILDDIR/test/test-results
 
 # Test for timeout utility
 if command -v timeout >/dev/null; then
-    TEST_TIMEOUT_CMD="timeout 2m"
-    echo "INFO: using 2 minute timeout for tests"
+    TEST_TIMEOUT=${NOTMUCH_TEST_TIMEOUT:-2m}
+    TEST_TIMEOUT_CMD="timeout $TEST_TIMEOUT"
+    echo "INFO: using $TEST_TIMEOUT timeout for tests"
 else
     TEST_TIMEOUT_CMD=""
 fi