diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-21 20:07:10 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-21 20:07:10 +0200 |
| commit | 2f0ac27ec92840cab408e5f5a71d225be070cc0f (patch) | |
| tree | c1c6e879208b2b35dedc9690ab077bc36cfcd585 /integrationtests/cmd/ioworkload | |
| parent | 5824a1959b27643575c5b1335f211687566b8449 (diff) | |
Verify harness handles workload crash/nonzero exit (task 343)
Add crash scenario to ioworkload that exits non-zero, and a test
verifying the harness returns a clear error mentioning 'workload',
reports a valid PID, and returns no records.
Amp-Thread-ID: https://ampcode.com/threads/T-019c815e-6fb6-714a-a4db-37522416ea9a
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'integrationtests/cmd/ioworkload')
| -rw-r--r-- | integrationtests/cmd/ioworkload/scenarios.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/integrationtests/cmd/ioworkload/scenarios.go b/integrationtests/cmd/ioworkload/scenarios.go index 06e202d..1ca7328 100644 --- a/integrationtests/cmd/ioworkload/scenarios.go +++ b/integrationtests/cmd/ioworkload/scenarios.go @@ -11,6 +11,7 @@ import ( // scenarios maps scenario names to their execution functions. var scenarios = map[string]func() error{ + "crash": crash, "open-basic": openBasic, "open-creat": openCreat, "open-by-handle-at": openByHandleAt, @@ -1576,3 +1577,9 @@ func ioUringSetupRing(entries uint32) (int, error) { } return int(fd), nil } + +// crash simulates a workload that fails with a non-zero exit code. +// Used to verify the test harness handles workload failures gracefully. +func crash() error { + return fmt.Errorf("intentional crash for testing") +} |
