From 170383aad03829c4bf1d1bf9843111979d3c20a8 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Mon, 24 Jul 2017 14:30:24 -0700 Subject: [PATCH 01/22] travis-ci: unshallow git clone so git-describe works For flux version to be properly detected, we need to at least fetch tags and possibly also unshallow the git clone. Do this before running configure in travis-ci. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index b6194ed50f66..88e36177bfbf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,6 +85,8 @@ before_install: script: # Skip build if we already ran coverity-scan - test "${TRAVIS_BRANCH}" != 'coverity_scan' || exit 0 + # Force git to update the shallow clone and include tags so git-describe works + - git fetch --unshallow --tags - ulimit -c unlimited - export CC="ccache $CC" - export MAKECMDS="make -j 2 distcheck" From 7467d76dfaa7dacb10eb955b84a05e6e911a2e71 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Fri, 21 Jul 2017 15:36:59 -0700 Subject: [PATCH 02/22] t0001-basic.t: fix broken &&-chain in tests Fix broken `&&`-chains in some tests --- t/t0001-basic.t | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/t/t0001-basic.t b/t/t0001-basic.t index cb9e2937f26c..03866b8cfd34 100755 --- a/t/t0001-basic.t +++ b/t/t0001-basic.t @@ -55,11 +55,11 @@ test_expect_success 'flux-start in subprocess/pmi mode works (size 2)' " flux start ${BUG1006} --size=2 'flux comms info' | grep 'size=2' " test_expect_success 'flux-start with size 1 has no peers' " - flux start ${BUG1006} --size=1 'flux comms idle' > idle.out + flux start ${BUG1006} --size=1 'flux comms idle' > idle.out && ! grep 'idle' idle.out " test_expect_success 'flux-start with size 2 has a peer' " - flux start ${BUG1006} --size=2 'flux comms idle' > idle.out + flux start ${BUG1006} --size=2 'flux comms idle' > idle.out && grep 'idle' idle.out " test_expect_success 'flux-start --size=1 --bootstrap=selfpmi works' " @@ -254,10 +254,14 @@ test_expect_success 'flux-help command can display manpages for api calls' ' EOF MANPATH=${PWD}/man FLUX_IGNORE_NO_DOCS=y flux help flux_foo | grep "^FOO(3)" ' -test_expect_success 'flux-help returns nonzero exit code from man(1)' ' +missing_man_code() +{ man notacommand >/dev/null 2>&1 - code=$? - test_expect_code $code eval FLUX_IGNORE_NO_DOCS=y flux help notacommand + echo $? +} +test_expect_success 'flux-help returns nonzero exit code from man(1)' ' + test_expect_code $(missing_man_code) \ + eval FLUX_IGNORE_NO_DOCS=y flux help notacommand ' test_expect_success 'flux appends colon to missing or unset MANPATH' ' (unset MANPATH && flux /usr/bin/printenv | grep "MANPATH=.*:$") && From 686a5722311a6b6dffb9e0f180380fe67ef0a311 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Fri, 21 Jul 2017 15:37:41 -0700 Subject: [PATCH 03/22] t0003-module.t: fix broken &&-chain in tests Fix some broken &&-chains in some sharness tests. In some cases, the `&&` chain was broken presumably because a call was expected to fail, e.g. in the valid/invalid rank flux-module load/unload tests. These cases were fixed by either adding `!` or using `test_must_fail`. --- t/t0003-module.t | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/t/t0003-module.t b/t/t0003-module.t index 625fdd082f44..e9ea5b1261c3 100755 --- a/t/t0003-module.t +++ b/t/t0003-module.t @@ -99,52 +99,52 @@ test_expect_success 'module: insmod returns initialization error' ' ' test_expect_success 'module: list fails on invalid rank' ' - flux module list -r $(invalid_rank) 2> stderr + flux module list -r $(invalid_rank) 2> stderr && grep "No route to host" stderr ' test_expect_success 'module: load fails on invalid rank' ' - flux module load -r $(invalid_rank) \ - ${FLUX_BUILD_DIR}/t/module/.libs/parent.so 2> stderr + test_must_fail flux module load -r $(invalid_rank) \ + ${FLUX_BUILD_DIR}/t/module/.libs/parent.so 2> stderr && grep "No route to host" stderr ' test_expect_success 'module: remove fails on invalid rank' ' flux module load \ - ${FLUX_BUILD_DIR}/t/module/.libs/parent.so - flux module remove -r $(invalid_rank) parent 2> stderr - flux module remove parent + ${FLUX_BUILD_DIR}/t/module/.libs/parent.so && + flux module remove -r $(invalid_rank) parent 2> stderr && + flux module remove parent && grep "No route to host" stderr ' test_expect_success 'module: load works on valid and invalid rank' ' - flux module load -r 0,$(invalid_rank) \ - ${FLUX_BUILD_DIR}/t/module/.libs/parent.so 1> stdout 2> stderr + test_must_fail flux module load -r 0,$(invalid_rank) \ + ${FLUX_BUILD_DIR}/t/module/.libs/parent.so >stdout 2>stderr && flux module list -r 0 | grep parent && grep "No route to host" stderr ' test_expect_success 'module: list works on valid and invalid rank' ' - flux module list -r 0,$(invalid_rank) 1> stdout 2> stderr + flux module list -r 0,$(invalid_rank) 1> stdout 2> stderr && grep "parent" stdout && grep "No route to host" stderr ' test_expect_success 'module: remove works on valid and invalid rank' ' - flux module load -r 0,$(invalid_rank) \ - ${FLUX_BUILD_DIR}/t/module/.libs/parent.so - flux module remove -r 0,$(invalid_rank) parent 2> stderr + ! flux module load -r 0,$(invalid_rank) \ + ${FLUX_BUILD_DIR}/t/module/.libs/parent.so && + flux module remove -r 0,$(invalid_rank) parent 2> stderr && ! flux module list -r 0 | grep parent && grep "No route to host" stderr ' test_expect_success 'module: load fails on invalid module' ' - flux module load nosuchmodule 2> stderr + ! flux module load nosuchmodule 2> stderr && grep "nosuchmodule: not found in module search path" stderr ' test_expect_success 'module: remove fails on invalid module' ' - flux module remove nosuchmodule 2> stderr + flux module remove nosuchmodule 2> stderr && grep "nosuchmodule: No such file or directory" stderr ' @@ -207,14 +207,14 @@ test_expect_success 'flux module stats --parse "#event (tx)" counts events' ' test_expect_success 'flux module stats --clear works' ' flux event pub xyz && - flux module stats --clear $TESTMOD + flux module stats --clear $TESTMOD && EVENT_TX2=$(flux module stats --parse "#event (tx)" $TESTMOD) && test "$EVENT_TX" = 0 ' test_expect_success 'flux module stats --clear-all works' ' flux event pub xyz && - flux module stats --clear-all $TESTMOD + flux module stats --clear-all $TESTMOD && EVENT_TX2=$(flux module stats --parse "#event (tx)" $TESTMOD) && test "$EVENT_TX" = 0 ' @@ -275,9 +275,9 @@ test_expect_success 'flux module load "noexist" fails' ' test_expect_success 'flux module detects bad nodeset' ' ! flux module load -r smurf kvs 2>badns-load.out && - grep -q "target nodeset" badns-load.out + grep -q "target nodeset" badns-load.out && ! flux module remove -r smurf kvs 2>badns-remove.out && - grep -q "target nodeset" badns-remove.out + grep -q "target nodeset" badns-remove.out && ! flux module list -r smurf 2>badns-list.out && grep -q "target nodeset" badns-list.out ' From 6a9b3579c7684031da2d7ff70532ded762eb9e92 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Sat, 22 Jul 2017 07:11:05 -0700 Subject: [PATCH 04/22] t0005-exec.t: fix broken &&-chains in tests Where appropriate, fix broken &&-chain in tests. The chain-lint check kludgery in sharness doesn't like when processes are sent into background within the test, so add a flux_exec_bg() shell function to wrap sending flux-exec into that background. --- t/t0005-exec.t | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/t/t0005-exec.t b/t/t0005-exec.t index 02a0382e4c97..cb1bbbb195f3 100755 --- a/t/t0005-exec.t +++ b/t/t0005-exec.t @@ -31,7 +31,8 @@ test_expect_success 'exec to non-existent rank is an error' ' ' test_expect_success 'exec to valid and invalid ranks works' ' - flux exec -r 0,$(invalid_rank) echo working 1>stdout 2>stderr stdout 2>stderr expected <expected <test_signal.sh <<-EOF && #!/bin/bash @@ -157,18 +159,20 @@ test_expect_success 'signal forwarding works' ' test_expect_code 143 run_timeout 5 ./test_signal.sh TERM ' +flux_exec_bg() { flux exec "$@" /dev/null && + flux ps -r1 | grep ".* 1 .*sleep$" && kill -INT $p && test_expect_code 130 wait $p ' test_expect_success 'process listing works - multiple processes' ' - flux exec -r0-3 sleep 100 stderr + flux ps -r $(invalid_rank) 2> stderr && grep "No route to host" stderr ' test_expect_success 'process listing with valid and invalid ranks' ' - flux exec -r 0,$(invalid_rank) sleep 100 stdout 2> stderr && count1=$(grep -c sleep stdout) && @@ -209,8 +213,8 @@ test_expect_success 'process listing with valid and invalid ranks' ' ' test_expect_success 'flux-exec disconnect terminates all running processes' ' - flux exec -r0-3 sleep 100 expected && cat expected | run_timeout 3 flux exec -l -r0-3 cat >output && for i in $(seq 0 3); do - sed -n "s/^$i: //p" output > output.$i + sed -n "s/^$i: //p" output > output.$i && test_cmp expected output.$i done ' From 9afdff582ac5f34ed0e1bf8f0ddeb0c745325928 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Sat, 22 Jul 2017 07:15:09 -0700 Subject: [PATCH 05/22] t0007-ping.t: fix broken &&-chain in tests Fix broken &&-chain in tests so that --chain-lint passes on this test. --- t/t0007-ping.t | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/t/t0007-ping.t b/t/t0007-ping.t index b000be4624d5..dfb2c9da33fb 100755 --- a/t/t0007-ping.t +++ b/t/t0007-ping.t @@ -61,100 +61,100 @@ test_expect_success 'ping all works with 64K payload' ' ' test_expect_success 'ping fails on invalid rank (specified as target)' ' - run_timeout 5 flux ping --count 1 $(invalid_rank) 2>stderr + run_timeout 5 flux ping --count 1 $(invalid_rank) 2>stderr && grep -q "No route to host" stderr ' test_expect_success 'ping fails on invalid rank (specified in option)' ' - run_timeout 5 flux ping --count 1 --rank $(invalid_rank) cmb 2>stderr + run_timeout 5 flux ping --count 1 --rank $(invalid_rank) cmb 2>stderr && grep -q "No route to host" stderr ' test_expect_success 'ping works on valid and invalid rank' ' - run_timeout 5 flux ping --count 1 --rank 0,$(invalid_rank) cmb 1>stdout 2>stderr + run_timeout 5 flux ping --count 1 --rank 0,$(invalid_rank) cmb 1>stdout 2>stderr && grep -q "No route to host" stderr && grep -q "0,$(invalid_rank)!cmb.ping" stdout ' test_expect_success 'ping fails on invalid target' ' - run_timeout 5 flux ping --count 1 --rank 0 nosuchtarget 2>stderr + run_timeout 5 flux ping --count 1 --rank 0 nosuchtarget 2>stderr && grep -q "Function not implemented" stderr ' test_expect_success 'ping output format for "any" single rank is correct (default)' ' - run_timeout 5 flux ping --count 1 cmb 1>stdout + run_timeout 5 flux ping --count 1 cmb 1>stdout && grep -q "^cmb.ping" stdout && grep -q -E "time=[0-9]+\.[0-9]+ ms" stdout ' test_expect_success 'ping output format for "any" single rank is correct (format 1)' ' - run_timeout 5 flux ping --count 1 --rank any cmb 1>stdout + run_timeout 5 flux ping --count 1 --rank any cmb 1>stdout && grep -q "^cmb.ping" stdout && grep -q -E "time=[0-9]+\.[0-9]+ ms" stdout ' test_expect_success 'ping output format for "any" single rank is correct (format 2)' ' - run_timeout 5 flux ping --count 1 any!cmb 1>stdout + run_timeout 5 flux ping --count 1 any!cmb 1>stdout && grep -q "^cmb.ping" stdout && grep -q -E "time=[0-9]+\.[0-9]+ ms" stdout ' test_expect_success 'ping output format for "any" single rank is correct (format 3)' ' - run_timeout 5 flux ping --count 1 any 1>stdout + run_timeout 5 flux ping --count 1 any 1>stdout && grep -q "^cmb.ping" stdout && grep -q -E "time=[0-9]+\.[0-9]+ ms" stdout ' test_expect_success 'ping output format for specific single rank is correct (format 1)' ' - run_timeout 5 flux ping --count 1 --rank 0 cmb 1>stdout + run_timeout 5 flux ping --count 1 --rank 0 cmb 1>stdout && grep -q "^0!cmb.ping" stdout && grep -q -E "time=[0-9]+\.[0-9]+ ms" stdout ' test_expect_success 'ping output format for specific single rank is correct (format 2)' ' - run_timeout 5 flux ping --count 1 0!cmb 1>stdout + run_timeout 5 flux ping --count 1 0!cmb 1>stdout && grep -q "^0!cmb.ping" stdout && grep -q -E "time=[0-9]+\.[0-9]+ ms" stdout ' test_expect_success 'ping output format for specific single rank is correct (format 3)' ' - run_timeout 5 flux ping --count 1 0 1>stdout + run_timeout 5 flux ping --count 1 0 1>stdout && grep -q "^0!cmb.ping" stdout && grep -q -E "time=[0-9]+\.[0-9]+ ms" stdout ' test_expect_success 'ping output format for specific multiple ranks is correct (format 1)' ' - run_timeout 5 flux ping --count 1 --rank 0-1 cmb 1>stdout + run_timeout 5 flux ping --count 1 --rank 0-1 cmb 1>stdout && grep -q "^0-1!cmb.ping" stdout && grep -q -E "time=\([0-9]+\.[0-9]+:[0-9]+\.[0-9]+:[0-9]+\.[0-9]+\)" stdout ' test_expect_success 'ping output format for specific multiple ranks is correct (format 2)' ' - run_timeout 5 flux ping --count 1 0-1!cmb 1>stdout + run_timeout 5 flux ping --count 1 0-1!cmb 1>stdout && grep -q "^0-1!cmb.ping" stdout && grep -q -E "time=\([0-9]+\.[0-9]+:[0-9]+\.[0-9]+:[0-9]+\.[0-9]+\)" stdout ' test_expect_success 'ping output format for specific multiple ranks is correct (format 3)' ' - run_timeout 5 flux ping --count 1 0-1 1>stdout + run_timeout 5 flux ping --count 1 0-1 1>stdout && grep -q "^0-1!cmb.ping" stdout && grep -q -E "time=\([0-9]+\.[0-9]+:[0-9]+\.[0-9]+:[0-9]+\.[0-9]+\)" stdout ' test_expect_success 'ping output format for all ranks is correct (format 1)' ' - run_timeout 5 flux ping --count 1 --rank all cmb 1>stdout + run_timeout 5 flux ping --count 1 --rank all cmb 1>stdout && grep -q "^all!cmb.ping" stdout && grep -q -E "time=\([0-9]+\.[0-9]+:[0-9]+\.[0-9]+:[0-9]+\.[0-9]+\)" stdout ' test_expect_success 'ping output format for all ranks is correct (format 2)' ' - run_timeout 5 flux ping --count 1 all!cmb 1>stdout + run_timeout 5 flux ping --count 1 all!cmb 1>stdout && grep -q "^all!cmb.ping" stdout && grep -q -E "time=\([0-9]+\.[0-9]+:[0-9]+\.[0-9]+:[0-9]+\.[0-9]+\)" stdout ' test_expect_success 'ping output format for all ranks is correct (format 3)' ' - run_timeout 5 flux ping --count 1 all 1>stdout + run_timeout 5 flux ping --count 1 all 1>stdout && grep -q "^all!cmb.ping" stdout && grep -q -E "time=\([0-9]+\.[0-9]+:[0-9]+\.[0-9]+:[0-9]+\.[0-9]+\)" stdout ' @@ -164,24 +164,24 @@ test_expect_success 'ping output format for all ranks is correct (format 3)' ' # rank 1 should work test_expect_success 'ping with "upstream" fails on rank 0' ' - run_timeout 5 flux exec --rank 0 flux ping --count 1 --rank upstream cmb 2>stderr + run_timeout 5 flux exec --rank 0 flux ping --count 1 --rank upstream cmb 2>stderr && grep -q "No route to host" stderr ' test_expect_success 'ping with "upstream" works (format 1)' ' - run_timeout 5 flux exec --rank 1 flux ping --count 1 --rank upstream cmb 1>stdout + run_timeout 5 flux exec --rank 1 flux ping --count 1 --rank upstream cmb 1>stdout && grep -q "^upstream!cmb.ping" stdout && grep -q -E "time=[0-9]+\.[0-9]+ ms" stdout ' test_expect_success 'ping with "upstream" works (format 2)' ' - run_timeout 5 flux exec --rank 1 flux ping --count 1 upstream!cmb 1>stdout + run_timeout 5 flux exec --rank 1 flux ping --count 1 upstream!cmb 1>stdout && grep -q "^upstream!cmb.ping" stdout && grep -q -E "time=[0-9]+\.[0-9]+ ms" stdout ' test_expect_success 'ping with "upstream" works (format 3)' ' - run_timeout 5 flux exec --rank 1 flux ping --count 1 upstream 1>stdout + run_timeout 5 flux exec --rank 1 flux ping --count 1 upstream 1>stdout && grep -q "^upstream!cmb.ping" stdout && grep -q -E "time=[0-9]+\.[0-9]+ ms" stdout ' From 91d0d5cb7b182adf4384bb0b5b05a0406435ad78 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Sat, 22 Jul 2017 07:18:05 -0700 Subject: [PATCH 06/22] t0009-dmesg.t: fix broken &&-chain in tests Add missing `&&`-chain in tests to make --chain-lint happy. --- t/t0009-dmesg.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t0009-dmesg.t b/t/t0009-dmesg.t index 9c75f1cad9a0..67fe064f344b 100755 --- a/t/t0009-dmesg.t +++ b/t/t0009-dmesg.t @@ -54,13 +54,13 @@ test_expect_success 'ring buffer wraps over old entries' ' flux logger hello_wrap1 && flux logger hello_wrap2 && flux logger hello_wrap3 && - ! flux dmesg | grep -q hello_wrap1 + ! flux dmesg | grep -q hello_wrap1 && flux setattr log-ring-size $OLD_RINGSIZE ' # Try to make flux dmesg get an EPROTO error test_expect_success 'logged non-ascii characters handled ok' ' - /bin/echo -n -e "\xFF\xFE\x82\x00" | flux logger + /bin/echo -n -e "\xFF\xFE\x82\x00" | flux logger && flux dmesg ' From 14b14151eb77a589247d58df9ed013ca568f94fb Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Sat, 22 Jul 2017 07:30:40 -0700 Subject: [PATCH 07/22] t0010-generic-utils.t: fix flux-version check The check for flux-version output wasn't doing anything becuase of leftover debugging in the test. In fact, the test itself had been failing because of the use of extended regex pattern. Remove the debugging from the test and fix the regex pattern. --- t/t0010-generic-utils.t | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/t/t0010-generic-utils.t b/t/t0010-generic-utils.t index c0db6bb0a602..5a6ab0c4c28b 100755 --- a/t/t0010-generic-utils.t +++ b/t/t0010-generic-utils.t @@ -27,9 +27,7 @@ test_expect_success 'event: can subscribe' ' ' test_expect_success 'version: reports an expected string' ' - set -x - flux version | grep -q "flux-core-[0-9]+\.[0-9]+\.[0-9]" - set +x + flux version | grep -q "flux-core-[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*" ' # heaptrace is only enabled if configured --with-tcmalloc From 0d30426671ada654016ad9f8db1e076247b5303e Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Sat, 22 Jul 2017 07:33:02 -0700 Subject: [PATCH 08/22] t0010-generic-utils.t: fix broken &&-chain in test Fix the broken &&-chain in the heaptrace tests by pulling out the ||-based output checks into their own shell function. --- t/t0010-generic-utils.t | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/t/t0010-generic-utils.t b/t/t0010-generic-utils.t index 5a6ab0c4c28b..21e480d68fe7 100755 --- a/t/t0010-generic-utils.t +++ b/t/t0010-generic-utils.t @@ -30,15 +30,18 @@ test_expect_success 'version: reports an expected string' ' flux version | grep -q "flux-core-[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*" ' +heaptrace_error_check() +{ + output=$(flux heaptrace "$@" 2>&1) \ + || echo $output | grep -q "Function not implemented" +} + # heaptrace is only enabled if configured --with-tcmalloc # so ENOSYS is a valid response. We are at least testing that code path. test_expect_success 'heaptrace start' ' - output=$(flux heaptrace start heaptrace.out 2>&1) \ - || echo $output | grep -q "Function not implemented" - output=$(flux heaptrace dump "No reason" 2>&1) \ - || echo $output | grep -q "Function not implemented" - output=$(flux heaptrace stop 2>&1) \ - || echo $output | grep -q "Function not implemented" + heaptrace_error_check start heaptrace.out && + heaptrace_error_check dump "No reason" && + heaptrace_error_check stop ' From 917c8ea524528e23ef74e6a75ef2c9f3d1f137af Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Sat, 22 Jul 2017 10:04:20 -0700 Subject: [PATCH 09/22] t0015-cron.t: fix broken &&-chain in test Fix broken &&-chains in test so that --chain-lint doesn't complain. --- t/t0015-cron.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t0015-cron.t b/t/t0015-cron.t index c621159e7720..5c11bc459eeb 100755 --- a/t/t0015-cron.t +++ b/t/t0015-cron.t @@ -129,7 +129,7 @@ test_expect_success 'flux-cron event works' ' $SHARNESS_TEST_SRCDIR/scripts/event-trace.lua t.cron t.cron.complete \ flux event pub t.cron.trigger && cron_entry_check ${id} stats.count 1 && - cron_entry_check ${id} task.1.state Exited + cron_entry_check ${id} task.1.state Exited && $SHARNESS_TEST_SRCDIR/scripts/event-trace.lua t.cron t.cron.complete \ flux event pub t.cron.trigger && cron_entry_check ${id} stats.count 2 && @@ -160,7 +160,7 @@ test_expect_success 'flux-cron event --nth works' ' cron_entry_check ${id} typedata.counter 3 && $SHARNESS_TEST_SRCDIR/scripts/event-trace.lua t.cron t.cron.trigger \ flux event pub t.cron.trigger && - cron_entry_check ${id} stats.count 1 + cron_entry_check ${id} stats.count 1 && cron_entry_check ${id} typedata.counter 4 ' @@ -207,7 +207,7 @@ test_expect_success 'flux-cron can set timeout on tasks' ' $SHARNESS_TEST_SRCDIR/scripts/event-trace.lua t.cron t.cron.trigger \ flux event pub t.cron.trigger && sleep 0.1 && - i=0 + i=0 && while test $i -lt 5; do cron_entry_check ${id} task.1.state Timeout rc=$? @@ -216,7 +216,7 @@ test_expect_success 'flux-cron can set timeout on tasks' ' i=$((i+1)) echo "cron-${id}: $i" flux cron dump ${id} - done + done && test $rc -eq 0 ' test_expect_success 'flux-cron can set stop-on-failure' ' @@ -252,7 +252,7 @@ test_expect_success 'sync and sync_epsilon are set as expected' ' flux cron sync | grep "cron\.sync.*epsilon=0.025" ' test_expect_success 'tasks do not run until sync event' ' - id=$(flux_cron event t.cron.trigger flux event pub t.cron.complete) + id=$(flux_cron event t.cron.trigger flux event pub t.cron.complete) && test_when_finished "flux cron delete ${id}" && cron_entry_check ${id} stopped false && cron_entry_check ${id} stats.count 0 && From 11c38774adb0a21b61f842c2e579870fd805213b Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Tue, 25 Jul 2017 21:00:24 -0700 Subject: [PATCH 10/22] t1000-kvs.t: fix broken &&-chains in tests Fix broken &&-chains in tests so that --chain-lint doesn't complain. --- t/t1000-kvs.t | 86 +++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/t/t1000-kvs.t b/t/t1000-kvs.t index c4b3f7e4a6a1..58db2bb4e702 100755 --- a/t/t1000-kvs.t +++ b/t/t1000-kvs.t @@ -98,16 +98,16 @@ test_expect_success 'kvs: object get' ' test_kvs_key $KEY.object "{\"a\": 42}" ' test_expect_success 'kvs: dir' ' - flux kvs dir $DIR | sort >output - cat >expected <output && + cat >expected <output - cat >expected <output && + cat >expected <output - cat >expected <output && + cat >expected <output - cat >expected <output && + cat >expected <output - cat >expected <output && + cat >expected <output - cat >expected <output && + cat >expected <output && - cat >expected <expected <output && - cat >expected <expected <output - cat >expected <output && + cat >expected <expected <<-EOF + cat >expected <<-EOF && 0 1 EOF test_cmp watch_out expected ' -test_expect_success 'kvs: watch a key that at first doesnt exist' ' +test_expect_success NO_CHAIN_LINT 'kvs: watch a key that at first doesnt exist' ' flux kvs unlink -Rf $DIR && wait_watch_empty "$DIR.foo" rm -f watch_out @@ -648,14 +648,14 @@ test_expect_success 'kvs: watch a key that at first doesnt exist' ' wait_watch_current "nil" && flux kvs put $DIR.foo=1 && wait $watchpid - cat >expected <<-EOF + cat >expected <<-EOF && nil 1 EOF test_cmp watch_out expected ' -test_expect_success 'kvs: watch a key that gets removed' ' +test_expect_success NO_CHAIN_LINT 'kvs: watch a key that gets removed' ' flux kvs unlink -Rf $DIR && flux kvs put $DIR.foo=0 && wait_watch_put "$DIR.foo" "0" @@ -665,14 +665,14 @@ test_expect_success 'kvs: watch a key that gets removed' ' wait_watch_current "0" && flux kvs unlink $DIR.foo && wait $watchpid - cat >expected <<-EOF + cat >expected <<-EOF && 0 nil EOF test_cmp watch_out expected ' -test_expect_success 'kvs: watch a key that becomes a dir' ' +test_expect_success NO_CHAIN_LINT 'kvs: watch a key that becomes a dir' ' flux kvs unlink -Rf $DIR && flux kvs put $DIR.foo=0 && wait_watch_put "$DIR.foo" "0" @@ -682,7 +682,7 @@ test_expect_success 'kvs: watch a key that becomes a dir' ' wait_watch_current "0" && flux kvs put $DIR.foo.bar.baz=1 && wait $watchpid - cat >expected <<-EOF + cat >expected <<-EOF && 0 ====================== $DIR.foo.bar. @@ -691,7 +691,7 @@ test_expect_success 'kvs: watch a key that becomes a dir' ' test_cmp watch_out expected ' -test_expect_success 'kvs: watch a dir' ' +test_expect_success NO_CHAIN_LINT 'kvs: watch a dir' ' flux kvs unlink -Rf $DIR && flux kvs put $DIR.a.a=0 $DIR.a.b=0 && wait_watch_put "$DIR.a.a" "0" && @@ -702,7 +702,7 @@ test_expect_success 'kvs: watch a dir' ' wait_watch_current "======================" && flux kvs put $DIR.a.a=1 && wait $watchpid - cat >expected <<-EOF + cat >expected <<-EOF && $DIR.a. ====================== $DIR.a. @@ -711,7 +711,7 @@ test_expect_success 'kvs: watch a dir' ' test_cmp watch_out expected ' -test_expect_success 'kvs: watch a dir that at first doesnt exist' ' +test_expect_success NO_CHAIN_LINT 'kvs: watch a dir that at first doesnt exist' ' flux kvs unlink -Rf $DIR && wait_watch_empty "$DIR" rm -f watch_out @@ -720,7 +720,7 @@ test_expect_success 'kvs: watch a dir that at first doesnt exist' ' wait_watch_current "nil" && flux kvs put $DIR.a.a=1 && wait $watchpid - cat >expected <<-EOF + cat >expected <<-EOF && nil ====================== $DIR.a. @@ -729,7 +729,7 @@ test_expect_success 'kvs: watch a dir that at first doesnt exist' ' test_cmp watch_out expected ' -test_expect_success 'kvs: watch a dir that gets removed' ' +test_expect_success NO_CHAIN_LINT 'kvs: watch a dir that gets removed' ' flux kvs unlink -Rf $DIR && flux kvs put $DIR.a.a.a=0 $DIR.a.a.b=0 && wait_watch_put "$DIR.a.a.a" "0" && @@ -740,7 +740,7 @@ test_expect_success 'kvs: watch a dir that gets removed' ' wait_watch_current "======================" && flux kvs unlink -R $DIR.a && wait $watchpid - cat >expected <<-EOF + cat >expected <<-EOF && $DIR.a.a. ====================== nil @@ -749,7 +749,7 @@ test_expect_success 'kvs: watch a dir that gets removed' ' test_cmp watch_out expected ' -test_expect_success 'kvs: watch a dir, converted into a key' ' +test_expect_success NO_CHAIN_LINT 'kvs: watch a dir, converted into a key' ' flux kvs unlink -Rf $DIR && flux kvs put $DIR.a.a.a=0 $DIR.a.a.b=0 && wait_watch_put "$DIR.a.a.a" "0" && @@ -760,7 +760,7 @@ test_expect_success 'kvs: watch a dir, converted into a key' ' wait_watch_current "======================" && flux kvs put $DIR.a=1 && wait $watchpid - cat >expected <<-EOF + cat >expected <<-EOF && $DIR.a.a. ====================== 1 @@ -772,7 +772,7 @@ test_expect_success 'kvs: watch a dir, converted into a key' ' # to a key instead of $DIR.a to a key. Since we are watching $DIR.a, # prior test should see conversion of a $DIR.a to a key. This time, # $DIR.a is no longer valid and we should see 'nil' as a result. -test_expect_success 'kvs: watch a dir, prefix path converted into a key' ' +test_expect_success NO_CHAIN_LINT 'kvs: watch a dir, prefix path converted into a key' ' flux kvs unlink -Rf $DIR && flux kvs put $DIR.a.a.a=0 $DIR.a.a.b=0 && wait_watch_put "$DIR.a.a.a" "0" && @@ -783,7 +783,7 @@ test_expect_success 'kvs: watch a dir, prefix path converted into a key' ' wait_watch_current "======================" && flux kvs put $DIR=1 && wait $watchpid - cat >expected <<-EOF + cat >expected <<-EOF && $DIR.a.a. ====================== nil @@ -812,7 +812,7 @@ sort_watch_output() { return 0 } -test_expect_success 'kvs: watch a dir with -R' ' +test_expect_success NO_CHAIN_LINT 'kvs: watch a dir with -R' ' flux kvs unlink -Rf $DIR && flux kvs put $DIR.a.a=0 $DIR.a.b=0 && wait_watch_put "$DIR.a.a" "0" && @@ -824,7 +824,7 @@ test_expect_success 'kvs: watch a dir with -R' ' flux kvs put $DIR.a.a=1 && wait $watchpid sort_watch_output - cat >expected <<-EOF + cat >expected <<-EOF && $DIR.a.a = 0 $DIR.a.b = 0 ====================== @@ -835,7 +835,7 @@ test_expect_success 'kvs: watch a dir with -R' ' test_cmp watch_out_sorted expected ' -test_expect_success 'kvs: watch a dir with -R and -d' ' +test_expect_success NO_CHAIN_LINT 'kvs: watch a dir with -R and -d' ' flux kvs unlink -Rf $DIR && flux kvs put $DIR.a.a=0 $DIR.a.b=0 && wait_watch_put "$DIR.a.a" "0" && @@ -847,7 +847,7 @@ test_expect_success 'kvs: watch a dir with -R and -d' ' flux kvs put $DIR.a.a=1 && wait $watchpid sort_watch_output - cat >expected <<-EOF + cat >expected <<-EOF && $DIR.a.a $DIR.a.b ====================== From 461932320070ad817cd7d5dec70c879bd6a0a6d7 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Sat, 22 Jul 2017 10:07:06 -0700 Subject: [PATCH 11/22] t0016-cron-faketime.t: fix broken &&-chain in tests Fix broken &&-chain in tests so --chain-lint won't complain --- t/t0016-cron-faketime.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t0016-cron-faketime.t b/t/t0016-cron-faketime.t index cc6260f421f7..f2153a8ca2f6 100755 --- a/t/t0016-cron-faketime.t +++ b/t/t0016-cron-faketime.t @@ -60,7 +60,7 @@ test_expect_success 'libfaketime works' ' flux logger "libfaketime-test" && test "$(date +%s)" = $(date +%s --date="Jun 4 1991 00:00:00") && date +%s && - flux dmesg | grep libfaketime-test + flux dmesg | grep libfaketime-test && echo $now > ${FAKETIME_TIMESTAMP_FILE} ' test_expect_success 'load cron module' ' From bfb82aec5b60031c705ca29449addd93cd10b5a7 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Sun, 23 Jul 2017 11:49:06 -0700 Subject: [PATCH 12/22] t1001-barrier-basic.t: fix broken &&-chains in tests Fix broken &&-chains in tests so that --chain-lint stops complaining --- t/t1001-barrier-basic.t | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t1001-barrier-basic.t b/t/t1001-barrier-basic.t index 39c8f2911544..5910ef5b8bdc 100755 --- a/t/t1001-barrier-basic.t +++ b/t/t1001-barrier-basic.t @@ -32,20 +32,20 @@ test_expect_success 'barrier: blocks while incomplete' ' ' test_expect_success 'barrier: fails with name=NULL outside of LWJ' ' - unset FLUX_JOB_ID - unset SLURM_STEPID + unset FLUX_JOB_ID && + unset SLURM_STEPID && test_expect_code 1 ${tbarrier} --nprocs 1 ' test_expect_success 'barrier: succeeds with name=NULL inside LWJ' ' - unset SLURM_STEPID - FLUX_JOB_ID=1; export FLUX_JOB_ID + unset SLURM_STEPID && + FLUX_JOB_ID=1 && export FLUX_JOB_ID && flux exec ${tbarrier} --nprocs ${SIZE} ' test_expect_success 'barrier: succeeds with name=NULL inside SLURM step' ' - unset FLUX_LWJ_ID - SLURM_STEPID=1; export SLURM_STEPID + unset FLUX_LWJ_ID && + SLURM_STEPID=1 && export SLURM_STEPID && flux exec ${tbarrier} --nprocs ${SIZE} ' From 119fb7ac339a9f61622213a237d6d97b2ed09e7d Mon Sep 17 00:00:00 2001 From: Mark Grondona Date: Mon, 28 Aug 2017 21:23:00 +0000 Subject: [PATCH 13/22] t1002-kvs-extra.t: fix broken &&-chain in tests Fix a few broken &&-chains in tests so that --chain-lint doesn't complain. --- t/t1002-kvs-extra.t | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/t/t1002-kvs-extra.t b/t/t1002-kvs-extra.t index f3e92ba4a508..a596f3812e50 100755 --- a/t/t1002-kvs-extra.t +++ b/t/t1002-kvs-extra.t @@ -120,7 +120,7 @@ test_expect_success 'kvs: put using no-merge flag' ' ${KVSBASIC} put-no-merge $DIR.d=\"snerg\" && ${KVSBASIC} put-no-merge $DIR.e=true && flux kvs dir -R $DIR | sort >output && - cat >expected <expected <output && - cat >expected <expected <snapshot && ${KVSBASIC} put-treeobj $TEST.snap="`cat snapshot`" && - ${KVSBASIC} get-treeobj $TEST.snap >snapshot.cpy + ${KVSBASIC} get-treeobj $TEST.snap >snapshot.cpy && test_cmp snapshot snapshot.cpy ' @@ -285,7 +285,7 @@ test_expect_success 'kvs: unlink, walk 16x3 directory tree with dirat' ' ' test_expect_success 'kvs: store 2x4 directory tree and walk' ' - ${FLUX_BUILD_DIR}/t/kvs/dtree -h4 -w2 --prefix $TEST.dtree + ${FLUX_BUILD_DIR}/t/kvs/dtree -h4 -w2 --prefix $TEST.dtree && test $(flux kvs dir -R $TEST.dtree | wc -l) = 16 ' @@ -426,7 +426,7 @@ test_expect_success 'kvs: copy-tokvs and copy-fromkvs work' ' test_expect_success 'kvs: test that KVS_NO_MERGE works with kvs_commit()' ' THREADS=64 && OUTPUT=`${FLUX_BUILD_DIR}/t/kvs/commitmerge --nomerge ${THREADS} \ - $(basename ${SHARNESS_TEST_FILE})` + $(basename ${SHARNESS_TEST_FILE})` && test "$OUTPUT" = "${THREADS}" ' @@ -437,7 +437,7 @@ test_expect_success 'kvs: commit-merge disabling works' ' THREADS=64 && flux module remove -r 0 kvs && flux module load -r 0 kvs commit-merge=0 && - OUTPUT=`${FLUX_BUILD_DIR}/t/kvs/commitmerge ${THREADS} $(basename ${SHARNESS_TEST_FILE})` + OUTPUT=`${FLUX_BUILD_DIR}/t/kvs/commitmerge ${THREADS} $(basename ${SHARNESS_TEST_FILE})` && test "$OUTPUT" = "${THREADS}" ' From ed234c277892de8cf6f50ebba0d0e951bee27667 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Sun, 23 Jul 2017 17:32:33 -0700 Subject: [PATCH 14/22] t1008-proxy.t: fix broken &&-chains in test Fix broken &&-chain in tests so --chain-lint doesn't complain. Some tests were checking for failed commands with `command; test $? -ne 0 && ...` these were replaced with `test_must_fail command && ...` --- t/t1008-proxy.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/t1008-proxy.t b/t/t1008-proxy.t index 3b4b97de354d..93c433835a56 100755 --- a/t/t1008-proxy.t +++ b/t/t1008-proxy.t @@ -93,25 +93,25 @@ test_expect_success 'ssh:// can work with events' ' test_expect_success 'ssh:// with bad query option fails in flux_open()' ' FLUX_URI=ssh://localhost/$TEST_JOBID?badarg=bar FLUX_SSH=$TEST_SSH \ - flux getattr size 2>badarg.out; test $? -ne 0 && + test_must_fail flux getattr size 2>badarg.out && grep -q "flux_open:" badarg.out ' test_expect_success 'ssh:// with bad FLUX_SSH value fails in flux_open()' ' FLUX_URI=ssh://localhost/$TEST_JOBID FLUX_SSH=/noexist \ - flux getattr size 2>noexist.out; test $? -ne 0 && + test_must_fail flux getattr size 2>noexist.out && grep -q "flux_open:" noexist.out ' test_expect_success 'ssh:// with bad FLUX_SSH_RCMD value fails in flux_open()' ' FLUX_URI=ssh://localhost/$TEST_JOBID FLUX_SSH=$TEST_SSH \ - FLUX_SSH_RCMD=/nocmd flux getattr size 2>nocmd.out; test $? -ne 0 && + FLUX_SSH_RCMD=/nocmd test_must_fail flux getattr size 2>nocmd.out && grep -q "flux_open:" nocmd.out ' test_expect_success 'ssh:// with missing path component fails in flux_open()' ' FLUX_URI=ssh://localhost FLUX_SSH=$TEST_SSH \ - flux getattr size 2>nopath.out; test $? -ne 0 && + test_must_fail flux getattr size 2>nopath.out && grep -q "flux_open:" nopath.out ' From b5735d8de0acac71d86e5fcc66f9e3237aecd4e1 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Mon, 24 Jul 2017 07:00:03 -0700 Subject: [PATCH 15/22] t2000-wreck.t: fix broken &&-chains in tests Fix broken &&-chains in tests so --chain-lint doesn't complain. --- t/t2000-wreck.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t2000-wreck.t b/t/t2000-wreck.t index 22be704a854c..95644ba90806 100755 --- a/t/t2000-wreck.t +++ b/t/t2000-wreck.t @@ -138,7 +138,7 @@ test_expect_success 'wreck: job state events emitted' ' EOF test_cmp expected_states output_states ' -test_expect_success 'wreck: signaling wreckrun works' ' +test_expect_success NO_CHAIN_LINT 'wreck: signaling wreckrun works' ' flux wreckrun -n${SIZE} sleep 15 output_nx2 && - i=0 + i=0 && for n in $(seq 0 $((${SIZE}-1))); do echo "$i: $n"; echo "$((i+1)): $n"; i=$((i+2)); @@ -246,14 +246,14 @@ test_expect_success 'wreckrun: top level environment' ' test_cmp expected_top_env2 output_top_env2 ' test_expect_success 'wreck plugins can use wreck:log_msg()' ' - saved_pattern=$(flux getattr wrexec.lua_pattern) + saved_pattern=$(flux getattr wrexec.lua_pattern) && if test $? = 0; then test_when_finished \ "flux setattr wrexec.lua_pattern \"$saved_pattern\"" else test_when_finished \ "flux setattr --expunge wrexec.lua_pattern" - fi + fi && cat <<-EOF >test.lua && function rexecd_init () local rc, err = wreck:log_msg ("lwj.%d: plugin test successful", wreck.id) @@ -262,7 +262,7 @@ test_expect_success 'wreck plugins can use wreck:log_msg()' ' EOF flux setattr wrexec.lua_pattern "$(pwd)/*.lua" && flux wreckrun /bin/true && - flux dmesg | grep "plugin test successful" || (flux dmesg | grep lwj\.$(last_job_id) && false) + (flux dmesg | grep "plugin test successful" || (flux dmesg | grep lwj\.$(last_job_id) && false)) ' test_expect_success 'wreckrun: --detach supported' ' flux wreckrun --detach /bin/true | grep "^[0-9]" From 5f86dc320a986ae0d46814a7bb0a94ba0c1912d1 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Mon, 24 Jul 2017 07:09:07 -0700 Subject: [PATCH 16/22] t2001-jsc.t: fix broken &&-chains in tests Fix broken &&-chains in tests so that --chain-lint doesn't complain. --- t/t2001-jsc.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t2001-jsc.t b/t/t2001-jsc.t index 6c2808cd2479..e5585b1e5adb 100755 --- a/t/t2001-jsc.t +++ b/t/t2001-jsc.t @@ -216,7 +216,7 @@ EOF " test_expect_success 'jstat 10: update procdescs' " - flux kvs get $(flux wreck kvs-path 1).0.procdesc > output.10.1 + flux kvs get $(flux wreck kvs-path 1).0.procdesc > output.10.1 && flux jstat update 1 pdesc '{\"pdesc\": {\"procsize\":1, \"hostnames\":[\"0\"], \"executables\":[\"fake\"], \"pdarray\":[{\"pid\":8482,\"eindx\":0,\"hindx\":0}]}}' && flux kvs get $(flux wreck kvs-path 1).0.procdesc > output.10.2 && test_expect_code 1 diff output.10.1 output.10.2 From db5704440a88ab1a662b7164425aba626432b608 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Mon, 24 Jul 2017 07:10:59 -0700 Subject: [PATCH 17/22] t2005-hwloc-basic.t: fix broken &&-chain in test Fix a broken &&-chain in a test to make --chain-lint happy. --- t/t2005-hwloc-basic.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t2005-hwloc-basic.t b/t/t2005-hwloc-basic.t index bb539ce0169f..d8c4ea04cea4 100755 --- a/t/t2005-hwloc-basic.t +++ b/t/t2005-hwloc-basic.t @@ -128,7 +128,7 @@ test_expect_success 'hwloc: reload --walk-topology=no removes broken down topo' ' test_expect_success 'hwloc: reload fails on invalid rank' ' - flux hwloc reload -r $(invalid_rank) 2> stderr + flux hwloc reload -r $(invalid_rank) 2> stderr && grep "No route to host" stderr ' From 47b813eecd8dc0b61b0f27bc21c700ef93a6ff53 Mon Sep 17 00:00:00 2001 From: Mark Grondona Date: Tue, 29 Aug 2017 00:18:24 +0000 Subject: [PATCH 18/22] t3000-mpi-basic.t: fix broken &&-chain in test Fix a broken &&-chain in a test so that --chain-lint doesn't complain. --- t/t3000-mpi-basic.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t3000-mpi-basic.t b/t/t3000-mpi-basic.t index 50921216d1a6..f6d416056a92 100755 --- a/t/t3000-mpi-basic.t +++ b/t/t3000-mpi-basic.t @@ -38,7 +38,7 @@ for OPTS in "stdio-delay-commit"; do ' test_expect_success "mpi hello oversubscribed with $OPTS" ' - NTASKS=$((${SIZE}*4)); \ + NTASKS=$((${SIZE}*4)) && \ run_program 5 ${NTASKS} ${SIZE} ${FLUX_BUILD_DIR}/t/mpi/hello \ | tee oversub.$OPTS \ && grep -q "There are ${NTASKS} tasks" oversub.$OPTS From b64856dfeba46699cbe532e927c55208a0068638 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Wed, 26 Jul 2017 15:49:37 -0700 Subject: [PATCH 19/22] t0001-basic.t: run test_under_flux test under timeout Timeout the test_under_flux test after 5s in case the test hangs for unknown reason. --- t/t0001-basic.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t0001-basic.t b/t/t0001-basic.t index 03866b8cfd34..0460f9af0091 100755 --- a/t/t0001-basic.t +++ b/t/t0001-basic.t @@ -109,7 +109,7 @@ test_expect_success 'test_under_flux works' ' chmod +x .test.t && SHARNESS_TEST_DIRECTORY=`pwd` && export SHARNESS_TEST_SRCDIR SHARNESS_TEST_DIRECTORY FLUX_BUILD_DIR debug && - ./.test.t --verbose --debug >out 2>err + run_timeout 5 ./.test.t --verbose --debug >out 2>err ) && grep "size=2" test-under-flux/out ' From 62e28e08a35e2f5291ab936e5059e481654dde04 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Thu, 27 Jul 2017 10:09:25 -0700 Subject: [PATCH 20/22] t0001-basic.t: add timeouts to all flux-start invocations Since t0001-basic.t doesn't run under test_under_flux, it doesn't have a test timeout. To ensure invidual tests using flux-start do not hang the testsuite, add -o -Sinit.rc2_timeout option to each invocation of flux-start. --- t/t0001-basic.t | 60 ++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/t/t0001-basic.t b/t/t0001-basic.t index 0460f9af0091..7bd96c460868 100755 --- a/t/t0001-basic.t +++ b/t/t0001-basic.t @@ -30,6 +30,9 @@ test_expect_success 'flux-keygen works' ' rm -rf $tmpkeydir ' +# None of the individual tests should run over 10s +ARGS="-o -Sinit.rc2_timeout=10" + # # N.B. since we have many back to back flux-starts within this test, # and each instance runs out the shutdown grace period per issue #1006, @@ -41,54 +44,55 @@ test_expect_success 'flux-keygen works' ' # basic functionality... # BUG1006="-o,--shutdown-grace=0.1" +ARGS="$ARGS $BUG1006" test_expect_success 'broker --shutdown-grace option works' ' flux start -o,--shutdown-grace=0.1 /bin/true ' test_expect_success 'flux-start in exec mode works' " - flux start ${BUG1006} 'flux comms info' | grep 'size=1' + flux start ${ARGS} 'flux comms info' | grep 'size=1' " test_expect_success 'flux-start in subprocess/pmi mode works (size 1)' " - flux start ${BUG1006} --size=1 'flux comms info' | grep 'size=1' + flux start ${ARGS} --size=1 'flux comms info' | grep 'size=1' " test_expect_success 'flux-start in subprocess/pmi mode works (size 2)' " - flux start ${BUG1006} --size=2 'flux comms info' | grep 'size=2' + flux start ${ARGS} --size=2 'flux comms info' | grep 'size=2' " test_expect_success 'flux-start with size 1 has no peers' " - flux start ${BUG1006} --size=1 'flux comms idle' > idle.out && + flux start ${ARGS} --size=1 'flux comms idle' > idle.out && ! grep 'idle' idle.out " test_expect_success 'flux-start with size 2 has a peer' " - flux start ${BUG1006} --size=2 'flux comms idle' > idle.out && + flux start ${ARGS} --size=2 'flux comms idle' > idle.out && grep 'idle' idle.out " test_expect_success 'flux-start --size=1 --bootstrap=selfpmi works' " - flux start ${BUG1006} --size=1 --bootstrap=selfpmi /bin/true + flux start ${ARGS} --size=1 --bootstrap=selfpmi /bin/true " test_expect_success 'flux-start --size=1 --boostrap=pmi fails' " - test_must_fail flux start ${BUG1006} --size=1 --bootstrap=pmi /bin/true + test_must_fail flux start ${ARGS} --size=1 --bootstrap=pmi /bin/true " test_expect_success 'flux-start in exec mode passes through errors from command' " - test_must_fail flux start ${BUG1006} /bin/false + test_must_fail flux start ${ARGS} /bin/false " test_expect_success 'flux-start in subprocess/pmi mode passes through errors from command' " - test_must_fail flux start ${BUG1006} --size=1 /bin/false + test_must_fail flux start ${ARGS} --size=1 /bin/false " test_expect_success 'flux-start in exec mode passes exit code due to signal' " - test_expect_code 130 flux start ${BUG1006} 'kill -INT \$\$' + test_expect_code 130 flux start ${ARGS} 'kill -INT \$\$' " test_expect_success 'flux-start in subprocess/pmi mode passes exit code due to signal' " - test_expect_code 130 flux start ${BUG1006} --size=1 'kill -INT \$\$' + test_expect_code 130 flux start ${ARGS} --size=1 'kill -INT \$\$' " test_expect_success 'flux-start in exec mode works as initial program' " - flux start --size=2 flux start ${BUG1006} flux comms info | grep size=1 + flux start --size=2 flux start ${ARGS} flux comms info | grep size=1 " test_expect_success 'flux-start in subprocess/pmi mode works as initial program' " - flux start --size=2 flux start ${BUG1006} --size=1 flux comms info | grep size=1 + flux start --size=2 flux start ${ARGS} --size=1 flux comms info | grep size=1 " test_expect_success 'flux-start init.rc2_timeout attribute works' " - test_expect_code 143 flux start ${BUG1006} -o,-Sinit.rc2_timeout=0.1 sleep 5 + test_expect_code 143 flux start ${ARGS} -o,-Sinit.rc2_timeout=0.1 sleep 5 " test_expect_success 'test_under_flux works' ' @@ -114,7 +118,7 @@ test_expect_success 'test_under_flux works' ' grep "size=2" test-under-flux/out ' test_expect_success 'flux-start -o,--setattr ATTR=VAL can set broker attributes' ' - ATTR_VAL=`flux start ${BUG1006} -o,--setattr=foo-test=42 flux getattr foo-test` && + ATTR_VAL=`flux start ${ARGS} -o,--setattr=foo-test=42 flux getattr foo-test` && test $ATTR_VAL -eq 42 ' test_expect_success 'tbon.endpoint can be read' ' @@ -158,21 +162,21 @@ test_expect_success 'mcast.relay-endpoint not set by default' ' ' test_expect_success 'broker.rundir override works' ' RUNDIR=`mktemp -d` && - DIR=`flux start ${BUG1006} -o,--setattr=broker.rundir=$RUNDIR flux getattr broker.rundir` && + DIR=`flux start ${ARGS} -o,--setattr=broker.rundir=$RUNDIR flux getattr broker.rundir` && test "$DIR" = "$RUNDIR" && test -d $RUNDIR && rmdir $RUNDIR ' test_expect_success 'broker persist-directory works' ' PERSISTDIR=`mktemp -d` && - flux start ${BUG1006} -o,--setattr=persist-directory=$PERSISTDIR /bin/true && + flux start ${ARGS} -o,--setattr=persist-directory=$PERSISTDIR /bin/true && test -d $PERSISTDIR && test `ls -1 $PERSISTDIR|wc -l` -gt 0 && rm -rf $PERSISTDIR ' test_expect_success 'broker persist-filesystem works' ' PERSISTFS=`mktemp -d` && - PERSISTDIR=`flux start ${BUG1006} -o,--setattr=persist-filesystem=$PERSISTFS flux getattr persist-directory` && + PERSISTDIR=`flux start ${ARGS} -o,--setattr=persist-filesystem=$PERSISTFS flux getattr persist-directory` && test -d $PERSISTDIR && test `ls -1 $PERSISTDIR|wc -l` -gt 0 && rm -rf $PERSISTDIR && @@ -182,7 +186,7 @@ test_expect_success 'broker persist-filesystem works' ' test_expect_success 'broker persist-filesystem is ignored if persist-directory set' ' PERSISTFS=`mktemp -d` && PERSISTDIR=`mktemp -d` && - DIR=`flux start ${BUG1006} -o,--setattr=persist-filesystem=$PERSISTFS,--setattr=persist-directory=$PERSISTDIR \ + DIR=`flux start ${ARGS} -o,--setattr=persist-filesystem=$PERSISTFS,--setattr=persist-directory=$PERSISTDIR \ flux getattr persist-directory` && test "$DIR" = "$PERSISTDIR" && test `ls -1 $PERSISTDIR|wc -l` -gt 0 && @@ -191,24 +195,24 @@ test_expect_success 'broker persist-filesystem is ignored if persist-directory s ' # Use -eq hack to test that BROKERPID is a number test_expect_success 'broker broker.pid attribute is readable' ' - BROKERPID=`flux start ${BUG1006} flux getattr broker.pid` && + BROKERPID=`flux start ${ARGS} flux getattr broker.pid` && test -n "$BROKERPID" && test "$BROKERPID" -eq "$BROKERPID" ' test_expect_success 'broker broker.pid attribute is immutable' ' - test_must_fail flux start ${BUG1006} -o,--setattr=broker.pid=1234 flux getattr broker.pid + test_must_fail flux start ${ARGS} -o,--setattr=broker.pid=1234 flux getattr broker.pid ' test_expect_success 'broker --verbose option works' ' - flux start ${BUG1006} -o,-v /bin/true + flux start ${ARGS} -o,-v /bin/true ' test_expect_success 'broker --heartrate option works' ' - flux start ${BUG1006} -o,--heartrate=0.1 /bin/true + flux start ${ARGS} -o,--heartrate=0.1 /bin/true ' test_expect_success 'broker --k-ary option works' ' - flux start ${BUG1006} -s4 -o,--k-ary=1 /bin/true && - flux start ${BUG1006} -s4 -o,--k-ary=2 /bin/true && - flux start ${BUG1006} -s4 -o,--k-ary=3 /bin/true && - flux start ${BUG1006} -s4 -o,--k-ary=4 /bin/true + flux start ${ARGS} -s4 -o,--k-ary=1 /bin/true && + flux start ${ARGS} -s4 -o,--k-ary=2 /bin/true && + flux start ${ARGS} -s4 -o,--k-ary=3 /bin/true && + flux start ${ARGS} -s4 -o,--k-ary=4 /bin/true ' test_expect_success 'flux-help command list can be extended' ' @@ -316,7 +320,7 @@ test_expect_success 'scripts/waitfile works after 1s' ' ' # test for issue #1025 test_expect_success 'instance can stop cleanly with subscribers (#1025)' ' - flux start ${BUG1006} -s2 --bootstrap=selfpmi bash -c "nohup flux event sub hb &" + flux start ${ARGS} -s2 --bootstrap=selfpmi bash -c "nohup flux event sub hb &" ' test_done From 8abd53ff93504fffe67ab8b578e5c2608280f210 Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Mon, 28 Aug 2017 10:22:02 -0700 Subject: [PATCH 21/22] travis-ci: revert to VM builds Set `sudo: true` in .travis.yml to revert to VM based builds instead of container/docker builds on Travis-CI. This is done because our build appears to require more resources than are given to the container-based Travis builds. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 88e36177bfbf..a93eec93ac93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: c -sudo: false +sudo: true compiler: - gcc From 3341f7c49b1569d20adccd856f34a4302b74fc83 Mon Sep 17 00:00:00 2001 From: Mark Grondona Date: Mon, 28 Aug 2017 23:01:58 +0000 Subject: [PATCH 22/22] travis-ci: run one build with --chain-lint Add chain-lint check to the gcc-4.9 build in travis. This way, broken &&-chains will be detected before merging. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a93eec93ac93..b2a17ae04e6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ matrix: - compiler: clang env: CPPCHECK=t ARGS=--enable-sanitizer CC=clang-3.8 CXX=clang++-3.8 - compiler: gcc - env: CC=gcc-4.9 + env: CC=gcc-4.9 chain_lint=t - compiler: clang env: ARGS=--enable-caliper CC=clang-3.8 CXX=clang++-3.8