Skip to content

test: match ssh-agent socket path independent of platform layout - #298

Merged
ogulcanaydogan merged 1 commit into
jenkinsci:masterfrom
ogulcanaydogan:test/socket-path-platform-independent
Aug 4, 2026
Merged

test: match ssh-agent socket path independent of platform layout#298
ogulcanaydogan merged 1 commit into
jenkinsci:masterfrom
ogulcanaydogan:test/socket-path-platform-independent

Conversation

@ogulcanaydogan

Copy link
Copy Markdown
Contributor

SSHAgentStepWorkflowTest.sshAgentAvailableAfterRestart scans 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> (no ssh- segment, non-numeric suffix), so the pattern matched nothing and the test failed with expected 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 SSHAgentStepWorkflowTest class (9 tests) passes with the change.

Fixes #289

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 jglick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still unclear why this started failing in bom builds, which run on Linux, but 🤞

@krisstern

Copy link
Copy Markdown
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!

@ogulcanaydogan
ogulcanaydogan merged commit 1fd5735 into jenkinsci:master Aug 4, 2026
18 checks passed
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.

Current bug in tests that was discovered during the weekly BOM release for July 24, 2026

3 participants