Skip to content

Commit

Permalink
testsuite: cover response trace
Browse files Browse the repository at this point in the history
Problem: there is no test coverage for flux module trace and
flux overlay trace's special handling of response messages.

Add a test for a failing RPC with human-readable error.
  • Loading branch information
garlick committed Oct 11, 2024
1 parent 5a748b7 commit d462260
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
10 changes: 10 additions & 0 deletions t/t3400-overlay-trace.t
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ test_expect_success NO_CHAIN_LINT 'kvs.ping request/response was captured' '
test_expect_success NO_CHAIN_LINT 'kvs.ping request/response was captured with --full' '
$waitfile -t 60 -c 2 -p kvs.ping trace2.out
'
# This RPC happens to return a human readable error on failure
test_expect_success NO_CHAIN_LINT 'send one job-manager.kill (failing)' '
test_must_fail flux exec -r 1 flux job kill fuzzybunny
'
test_expect_success NO_CHAIN_LINT 'job-manager.kill request/response was captured' '
$waitfile -t 60 -c 2 -p "job%-manager.kill" trace.out
'
test_expect_success NO_CHAIN_LINT 'job-manager.kill request/response was captured with --full' '
$waitfile -t 60 -c 2 -p "job%-manager.kill" trace2.out
'
test_expect_success NO_CHAIN_LINT 'stop background trace' '
pid=$(cat trace.pid) &&
kill -15 $pid &&
Expand Down
15 changes: 13 additions & 2 deletions t/t3401-module-trace.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ test_expect_success 'reload heartbeat with increased heart rate' '
flux module reload heartbeat period=0.2s
'
test_expect_success NO_CHAIN_LINT 'start background trace' '
flux module trace kvs >trace.out &
flux module trace kvs job-manager >trace.out &
echo $! >trace.pid
'
test_expect_success NO_CHAIN_LINT 'start second background trace with --full' '
flux module trace --full kvs >trace1a.out &
flux module trace --full kvs job-manager >trace1a.out &
echo $! >trace1a.pid
'
test_expect_success NO_CHAIN_LINT 'heartbeat.pulse event was captured' '
Expand All @@ -43,6 +43,17 @@ test_expect_success NO_CHAIN_LINT 'kvs.ping request/response was captured' '
test_expect_success NO_CHAIN_LINT 'kvs.ping request/response was captured with --full' '
$waitfile -t 60 -c 2 -p kvs.ping trace1a.out
'
# This RPC happens to return a human readable error on failure
test_expect_success NO_CHAIN_LINT 'send one job-manager.kill (failing)' '
test_must_fail flux job kill fuzzybunny
'
test_expect_success NO_CHAIN_LINT 'job-manager.kill request/response was captured' '
$waitfile -t 60 -c 2 -p "job%-manager.kill" trace.out
'
test_expect_success NO_CHAIN_LINT 'job-manager.kill request/response was captured with --full' '
$waitfile -t 60 -c 2 -p "job%-manager.kill" trace1a.out
'

test_expect_success NO_CHAIN_LINT 'stop background trace' '
pid=$(cat trace.pid) &&
kill -15 $pid &&
Expand Down

0 comments on commit d462260

Please sign in to comment.