Skip to content

Commit fe5e897

Browse files
committed
testsuite: ensure instance reaches run state
Problem: the 0004-recovery system test restarts the system instance, which can cause the next test to fail if the instance doesn't enter run state quickly enough. Add a test that waits for the instance to reach run state.
1 parent 24f9e6c commit fe5e897

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

t/system/0004-recovery.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,12 @@ test_expect_success 'flux start --recover works from dump file' '
2020
test_expect_success 'restart flux' '
2121
sudo systemctl start flux
2222
'
23+
get_uptime_state () {
24+
local state=$(flux uptime | cut -d' ' -f3) || state=unknown
25+
echo $state
26+
}
27+
test_expect_success 'wait for flux to reach run state' '
28+
while test $(get_uptime_state) != run; do \
29+
sleep 1; \
30+
done
31+
'

0 commit comments

Comments
 (0)