Skip to content

Fix the Windows unit test step failing on the daemon orphan test - #621

Merged
gerardrecinto merged 1 commit into
masterfrom
fix-daemon-test-orphan-exe
Oct 23, 2026
Merged

gerardrecinto merged 1 commit into
masterfrom
fix-daemon-test-orphan-exe

Conversation

@gerardrecinto

Copy link
Copy Markdown
Collaborator

The Sanity (windows-latest) job has been exiting 1 with 'go: unlinkat ...sop-daemon.test.exe: Access is denied' although every test passes. The cause is the orphan test in cmd/sop-daemon: it starts a helper process that sleeps 20 seconds after the test ends, and Windows will not let go test delete the test binary while a copy is running.

This shortens the helper to 2 seconds and waits for it in a t.Cleanup. It passes locally on macOS. I cannot run Windows locally, so the Windows job on this PR is the check.

Thanks,
Gerard Recinto

The orphan test starts a helper that slept for 20 seconds after the test
finished. On Windows go test cannot delete the test binary while a copy is
running, so the unit tests step exited 1 with 'unlinkat sop-daemon.test.exe:
Access is denied' even though every test passed. Shorten the helper to 2
seconds and wait for it in test cleanup.

Thanks,
Gerard Recinto
@gerardrecinto gerardrecinto self-assigned this Oct 23, 2026
@github-actions

Copy link
Copy Markdown

Gemini PR Review

Reviewed commit: 60900cbc13ab6832de96f040532a1ffa4461018c
Verdict: FAIL

  • cmd/sop-daemon/main_test.go: The time.Sleep duration for the "sleep" test helper was reduced from 20 seconds to 2 seconds. This significant reduction could weaken existing tests that rely on a longer duration to properly exercise timeout mechanisms or validate the behavior of commands that are expected to run for extended periods. Without corresponding changes to timeouts under test or clear justification, this change risks altering test behavior or masking potential issues.

This result blocks merge. Push a fix and comment /gemini review. To contest a finding, see the Gemini dispute process in CONTRIBUTING.md.

@gerardrecinto

Copy link
Copy Markdown
Collaborator Author

/gemini dispute

  1. Finding: "The time.Sleep duration for the "sleep" test helper was reduced from 20 seconds to 2 seconds. This significant reduction could weaken existing tests that rely on a longer duration to properly exercise timeout mechanisms..."
  2. Reference: the case "sleep" branch in TestMain, cmd/sop-daemon/main_test.go.
  3. Claim status: Inferred. The finding does not name a test that depends on the 20 seconds.
  4. Evidence: grep for the sleep helper shows one user, the orphan helper at line 152 (SOP_DAEMON_TEST_HELPER=sleep). No other test sets it. The orphan test uses a 300 ms command timeout and requires the request to return within 8 seconds. The sleeper only has to outlive 300 ms to hold the output pipe open, which 2 seconds still does with margin.
  5. Docs: Windows cannot delete an executable while a copy is running; go test then prints "unlinkat ...test.exe: Access is denied" and exits 1. The failing log lines are in the Sanity (windows-latest) job on Add the deterministic-check line to the hero #617 and Rewrite the Pro card around the problem it solves #618.
  6. Reachability: the change only affects the orphan helper process lifetime.
  7. Tests: go test ./cmd/sop-daemon/ passes locally; the Windows job on this PR is the check for the fix itself.
  8. Compensating control: t.Cleanup waits 3 seconds so the helper has exited before the binary is deleted.
  9. Requested resolution: mark not applicable on the current commit.

Thanks,
Gerard Recinto

@gerardrecinto

Copy link
Copy Markdown
Collaborator Author

/gemini review

@github-actions

Copy link
Copy Markdown

Gemini PR Review

Reviewed commit: 60900cbc13ab6832de96f040532a1ffa4461018c
Verdict: PASS

  • The dispute regarding the reduction of time.Sleep in the case "sleep" test helper from 20 seconds to 2 seconds is accepted. The evidence provided, stating that grep shows no existing test explicitly sets SOP_DAEMON_TEST_HELPER=sleep, indicates that this code path is currently unused. Therefore, the change cannot weaken any existing tests.

@gerardrecinto
gerardrecinto merged commit bd47fce into master Oct 23, 2026
25 of 26 checks passed
@gerardrecinto
gerardrecinto deleted the fix-daemon-test-orphan-exe branch October 23, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant