test: match ssh-agent socket path independent of platform layout - #298
Merged
ogulcanaydogan merged 1 commit intoAug 4, 2026
Conversation
SSHAgentStepWorkflowTest.sshAgentAvailableAfterRestart matched the socket path with a regex tied to the /tmp/ssh-XXXX/agent.<pid> layout. On macOS the system ssh-agent creates the socket under ~/.ssh/agent/s.<id>.agent.<id>, so the pattern found no matches and the test failed with expected 2 but was 0. Match on the log label and capture whatever socket path follows, since the socket layout is an ssh-agent implementation detail that varies by platform. Fixes jenkinsci#289 Signed-off-by: Ogulcan Aydogan <[email protected]>
jglick
approved these changes
Aug 3, 2026
jglick
left a comment
Member
There was a problem hiding this comment.
Still unclear why this started failing in bom builds, which run on Linux, but 🤞
Member
|
I think the problem was not really related to the Linux setup for the recent BOM releases, but as some BOM maintainers like me and I think also @darinpope are using macOS this has some impact on our work while investigating this plugin. Thanks so much for the work @ogulcanaydogan! |
6 tasks
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.
SSHAgentStepWorkflowTest.sshAgentAvailableAfterRestartscans the build log for the ssh-agent socket path with a regex tied to the/tmp/ssh-XXXX/agent.<pid>layout. On macOS the system ssh-agent creates the socket under~/.ssh/agent/s.<id>.agent.<id>(nossh-segment, non-numeric suffix), so the pattern matched nothing and the test failed withexpected 2 but was 0.The socket path layout is an ssh-agent implementation detail, so the test now matches on the log label and captures whatever socket path follows. That passes on macOS and stays correct on Linux, where the old paths are just a subset of what the looser pattern accepts.
Testing done
Reproduced on macOS Tahoe 26.5.2: the test failed before the change and passes after. The full
SSHAgentStepWorkflowTestclass (9 tests) passes with the change.Fixes #289