From f661987a60738caf897cade796907328cfe59407 Mon Sep 17 00:00:00 2001 From: "lei.chen" Date: Wed, 14 Oct 2026 07:27:45 +0000 Subject: [PATCH] fix(scheduler-test): unlink the reconcile stdout-capture scratch files (bug-924 tail) test_sim_reconcile_unaccounted.c captures stdout through mkstemp() files in /tmp/xce_simreconcile_*, but only the shared capture_stdout_around() helper unlinked its file after reading it back -- the 4 inlined capture sites left theirs behind on every passing run (the mkdtemp shim does not intercept mkstemp, so nothing else removed them). Add the same close(fd); unlink(tmp) the file family's other capture helpers use to each of the 4 sites. Verified: scheduler sim reconcile unaccounted test passes and leaves no /tmp/xce_simreconcile_* files behind. Co-Authored-By: Claude Code --- src/scheduler/testsuite/test_sim_reconcile_unaccounted.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scheduler/testsuite/test_sim_reconcile_unaccounted.c b/src/scheduler/testsuite/test_sim_reconcile_unaccounted.c index 25ae9b65..cbef3fbf 100644 --- a/src/scheduler/testsuite/test_sim_reconcile_unaccounted.c +++ b/src/scheduler/testsuite/test_sim_reconcile_unaccounted.c @@ -800,6 +800,7 @@ static void test_reconcile_skips_job_that_already_has_accounts(void) TEST_ASSERT_TRUE(nread == len); } close(fd); + unlink(tmp); /* capture read back -- drop the scratch file (bug-924) */ TEST_ASSERT_EQUAL_PTR_MESSAGE( accounts_before, job->accounts, @@ -1189,6 +1190,7 @@ test_reconcile_reports_reconstructed_decision_through_existing_channel(void) TEST_ASSERT_TRUE(nread == len); } close(fd); + unlink(tmp); /* capture read back -- drop the scratch file (bug-924) */ /* The reconciliation itself (task 2.3) still happened. */ TEST_ASSERT_EQUAL_PTR(jalloc, job->allocs); @@ -1886,6 +1888,7 @@ test_reconcile_continue_mode_with_repl_state_suppresses_bare_decision_line( TEST_ASSERT_TRUE(nread == len); } close(fd); + unlink(tmp); /* capture read back -- drop the scratch file (bug-924) */ /* The reconciliation itself (task 2.3) still happened -- this gate only * ever affects the console print, nothing else in the reporting chain. */ @@ -1982,6 +1985,7 @@ test_reconcile_step_mode_with_repl_state_still_prints_bare_decision_line( TEST_ASSERT_TRUE(nread == len); } close(fd); + unlink(tmp); /* capture read back -- drop the scratch file (bug-924) */ TEST_ASSERT_EQUAL_PTR(jalloc, job->allocs); TEST_ASSERT_NOT_NULL(job->accounts);