From d462260007c489c521a944ecce881a5caf6b8f3e Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Thu, 10 Oct 2024 15:46:19 -0700 Subject: [PATCH] testsuite: cover response trace 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. --- t/t3400-overlay-trace.t | 10 ++++++++++ t/t3401-module-trace.t | 15 +++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/t/t3400-overlay-trace.t b/t/t3400-overlay-trace.t index 12ef672f7dd0..42d7157f878c 100755 --- a/t/t3400-overlay-trace.t +++ b/t/t3400-overlay-trace.t @@ -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 && diff --git a/t/t3401-module-trace.t b/t/t3401-module-trace.t index 86f4c22ccbef..b88ecc35f71e 100755 --- a/t/t3401-module-trace.t +++ b/t/t3401-module-trace.t @@ -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' ' @@ -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 &&