Skip to content

test: make teardown-already-stopped check independent of orphan reaping - #301

Merged
ogulcanaydogan merged 1 commit into
masterfrom
test/teardown-orphan-reaping
Aug 10, 2026
Merged

test: make teardown-already-stopped check independent of orphan reaping#301
ogulcanaydogan merged 1 commit into
masterfrom
test/teardown-orphan-reaping

Conversation

@ogulcanaydogan

Copy link
Copy Markdown
Contributor

Fixes #290.

The teardownDoesNotFailBuildWhenAgentAlreadyStopped test kills the agent inside the sshagent block and then asserts the log contains Failed to run ssh-agent -k. Whether teardown's own ssh-agent -k reports that failure depends on whether the environment reaps the orphaned agent (an init running as PID 1), which is exactly what @jglick pointed out. With a reaper the stale agent is gone and the kill fails as expected; with no reaper the stale PID lingers and the kill reports success, so the message never appears and the assertion fails. That is why the weekly and 2.541.x PCT lines were failing.

This asserts only that the build is not failed, which is the contract the test name describes and is independent of the environment.

Verified on Linux by running the single test in a container with the JVM as PID 1 (no reaper):

  • old test, no reaper: fails (reproduces the PCT failure)
  • old test, --init (reaper present): passes (confirms the init dependence)
  • fixed test, no reaper: passes
  • fixed test on the host with an init present: passes

The teardownDoesNotFailBuildWhenAgentAlreadyStopped test killed the agent
inside the block and then asserted that teardown logged "Failed to run
ssh-agent -k". Whether that failure is reported depends on the environment:
with an init reaping orphans (PID 1) the stale agent is gone and the kill
fails as expected, but with no reaper the stale PID lingers and the kill
reports success, so the message never appears. That made the PCT weekly and
2.541.x lines fail (#290).

Assert only that the build is not failed, which is the actual contract the
test name describes and is independent of the environment.

Signed-off-by: Ogulcan Aydogan <[email protected]>
@ogulcanaydogan
ogulcanaydogan requested a review from a team as a code owner August 10, 2026 15:02
@ogulcanaydogan
ogulcanaydogan merged commit 59904cc into master Aug 10, 2026
19 checks passed
@ogulcanaydogan
ogulcanaydogan deleted the test/teardown-orphan-reaping branch August 10, 2026 16:01
@jglick

jglick commented Aug 10, 2026

Copy link
Copy Markdown
Member

(BTW you can use the developer label for PRs like this, which merit a release but which end users do not care about.)

@ogulcanaydogan

Copy link
Copy Markdown
Contributor Author

Thanks, that is good to know. I will use developer for test and tooling changes like this going forward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recent few releases failed the PCT weekly and 2.541.x line tests

2 participants