| Age | Commit message (Collapse) | Author |
|
TestCleanupLeakedWorkloadTempDirCaughtByAssertion was order/concurrency
dependent: passed in isolation but its detection scanned the shared system
temp root (os.TempDir) for ANY "ioworkload-" directory via a before/after
diff. Real ioworkload scenario workloads legitimately create
ioworkload-<scenario>-* dirs in that same root while they run (in parallel
under `mage integrationTest`), so this test both falsely attributed them as
leaks and, worse, RemoveAll'd them out from under the still-running tests.
Fix: scope both detection and cleanup to a prefix unique to this single test
invocation (PID + sanitized t.Name()) via listWorkloadTempDirsWithPrefix and
newLeakedDirs. Other tests' temp dirs can no longer be observed or deleted.
Also fixed a latent detection bug: the intentional-leak workload script
hard-coded /tmp instead of os.TempDir(), so detection silently failed whenever
$TMPDIR differed from /tmp. The mktemp template now uses os.TempDir().
Removed the dead assertNoNewWorkloadTempDirs helper (defined, never called).
Verified: mage build OK; mage test green across repeated runs; mage generate
produces no diff; gofmt clean. A stress run with decoy ioworkload-<scenario>-*
dirs confirms they survive untouched.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
|
|
|
|
- Remove tautological temp dir tests that self-cleaned in script
- Add TestCleanupLeakedWorkloadTempDirCaughtByAssertion that creates
a dir without cleanup and verifies detection catches it
- Inline snapshotWorkloadTempDirs into listWorkloadTempDirs
- Add comment explaining assertNoNewWorkloadTempDirs cleanup behavior
- Add non-empty check in OutputDir test to prevent vacuous pass
- Fix .collapsed -> .collapsed.zst suffix consistency
Amp-Thread-ID: https://ampcode.com/threads/T-019c8172-052c-74fe-8d8d-34a0529d082c
Co-authored-by: Amp <amp@ampcode.com>
|
|
Add cleanup_test.go with 6 tests verifying:
- OutputDir contains only expected file types (.ior.zst, .collapsed.zst, .svg, bpf symlink)
- No ioworkload temp dirs leak on success or failure paths
- OutputDir only has bpf symlink after ior failure (no stale output)
- No artifacts leak outside the OutputDir
- Leak detection mechanism works (negative test)
Task: 343
Amp-Thread-ID: https://ampcode.com/threads/T-019c8172-052c-74fe-8d8d-34a0529d082c
Co-authored-by: Amp <amp@ampcode.com>
|