From da0fe20faaf2c3eea29af79b7e62bdd1546db568 Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Mon, 10 Feb 2025 19:36:18 -0800 Subject: [PATCH] testsuite: cover delayed shutdown Problem: there is no coverage for the new shutdown timer. Add a test. --- t/t0025-broker-state-machine.t | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/t/t0025-broker-state-machine.t b/t/t0025-broker-state-machine.t index 150662a2ba50..30b05752a5d7 100755 --- a/t/t0025-broker-state-machine.t +++ b/t/t0025-broker-state-machine.t @@ -334,4 +334,26 @@ test_expect_success 'cleanup gets SIGHUP after broker.cleanup-timeout expires' ' ./killbroker 15 60 ' +test_expect_success 'create hanging rc3 for rank > 0' ' + cat <<-EOT >rc3_hang && + #!/bin/sh + rank=\$(flux getattr rank) + test \$rank -eq 0 && exit 0 + sleep 5 + EOT + chmod +x rc3_hang +' + +test_expect_success 'run instance with short shutdown timeout' ' + flux start -s3 \ + -Slog-filename=shutdown.log \ + -Sbroker.rc1_path= \ + -Sbroker.rc3_path="$(pwd)/rc3_hang" \ + -Sbroker.shutdown-timeout=1s \ + true +' +test_expect_success 'appropriate message was logged' ' + grep "shutdown delayed" shutdown.log +' + test_done