test: make teardown-already-stopped check independent of orphan reaping - #301
Merged
Conversation
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]>
Member
|
(BTW you can use the |
Contributor
Author
|
Thanks, that is good to know. I will use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #290.
The
teardownDoesNotFailBuildWhenAgentAlreadyStoppedtest kills the agent inside thesshagentblock and then asserts the log containsFailed to run ssh-agent -k. Whether teardown's ownssh-agent -kreports 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):
--init(reaper present): passes (confirms the init dependence)