Skip to content

Stop the agent before removing runner directories - #1628

Merged
unflxw merged 1 commit into
mainfrom
fix/fork-spec-cleanup-race
Oct 1, 2026
Merged

unflxw merged 1 commit into
mainfrom
fix/fork-spec-cleanup-race

Conversation

@unflxw

@unflxw unflxw commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes a CI flaky test, such as this example on main: https://github.com/appsignal/appsignal-ruby/actions/runs/36077119086/job/107891105176

The integration runner deletes its per-run working directory as soon
as the script exits, but the agent the script started is a separate
process that is still running and writes a push payload into that
directory shortly after. When the write lands during the delete,
FileUtils.remove_entry raises Errno::ENOTEMPTY and the spec fails,
which the collector mode fork spec hits intermittently. When it lands
after, the agent recreates the directory and it is left behind. Kill
the agent named in agent.lock and wait for it to exit before removing
the directory.

[skip changeset]

The integration runner deletes its per-run working directory as soon
as the script exits, but the agent the script started is a separate
process that is still running and writes a push payload into that
directory shortly after. When the write lands during the delete,
`FileUtils.remove_entry` raises `Errno::ENOTEMPTY` and the spec fails,
which the collector mode fork spec hits intermittently. When it lands
after, the agent recreates the directory and it is left behind. Kill
the agent named in `agent.lock` and wait for it to exit before removing
the directory.

[skip changeset]
@backlog-helper

backlog-helper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

鉁旓笍 All good!

New issue guide | Backlog management | Rules | Feedback

@unflxw unflxw added dev happiness Issues that improve developer happiness once they are resolved. chore A small task that takes a day or two at the most. and removed dev happiness Issues that improve developer happiness once they are resolved. labels Sep 30, 2026
@unflxw
unflxw marked this pull request as ready for review September 30, 2026 10:29
@unflxw
unflxw merged commit d8e931e into main Oct 1, 2026
439 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore A small task that takes a day or two at the most.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants