|
- Add waitBoth unit tests: ior exit error, ior timeout, both timeout,
both succeed — using real processes (true/false/sleep)
- Add TestIorCrashReportsError: full harness test with fake ior binary
that exits with error, verifying error mentions 'ior' and workload PID
is returned
- Add TestIorStartFailureCleansUpWorkload: verifies workload process is
killed when ior binary doesn't exist, checking with signal 0
- Refactor waitBoth to accept grace duration parameter for testability
(production code passes iorShutdownGrace, tests use 500ms)
- Fix pipe drain in startWorkload: drain remaining stdout after reading
PID so cmd.Wait() doesn't block on pending I/O
- Add writeScript helper to helpers_test.go for creating fake binaries
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c8162-c1cf-7612-b8f5-84c61e3d2021
|