-
Notifications
You must be signed in to change notification settings - Fork 0
fix(test): cap Rstest worker socket paths #341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "agent-bundle": patch | ||
| --- | ||
|
|
||
| Keep Doctor socket fixtures reliable under long local-CI temporary directory names by deriving short, isolated Rstest worker roots. |
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
29 changes: 29 additions & 0 deletions
29
packages/agent-bundle/tests/rstest-worker-isolation.test.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import { join } from 'node:path'; | ||
|
|
||
| import { expect, it } from '@rstest/core'; | ||
|
|
||
| import { rstestWorkerRootPath } from '../../../rstest.worker-isolation.ts'; | ||
|
|
||
| it('keeps Doctor socket fixtures below the Linux AF_UNIX pathname cap', () => { | ||
| const longLocalCiRoot = join( | ||
| '/tmp', | ||
| `abci-repository-hash-${'verify-current-pathological-node-version-'.repeat(3)}`, | ||
| ); | ||
| const workerRoot = rstestWorkerRootPath(longLocalCiRoot, '123', 'linux'); | ||
| const longestDoctorEndpoint = join( | ||
| workerRoot, | ||
| 'agent-bundle-doctor-XXXXXX', | ||
| 'endpoints', | ||
| 'event-identity.sock', | ||
| ); | ||
|
|
||
| // Linux sun_path is 108 bytes including NUL; 96 leaves 12 bytes of headroom. | ||
| expect(Buffer.byteLength(longestDoctorEndpoint, 'utf8') + 1).toBeLessThanOrEqual(96); | ||
| }); | ||
|
|
||
| it('isolates concurrent Rstest invocations that share a host temporary root', () => { | ||
| const firstRoot = rstestWorkerRootPath('/tmp', '1', 'linux', '/workspace/first\0' + '101'); | ||
| const secondRoot = rstestWorkerRootPath('/tmp', '1', 'linux', '/workspace/second\0' + '202'); | ||
|
|
||
| expect(firstRoot).not.toBe(secondRoot); | ||
| }); |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
check:local-ciis run repeatedly,scripts/local-ci.mjsdeletes and recreates only the per-legTMPDIR, but this path now lives beside it directly under/tmp. Consequently, worker caches such ascache/cmd-<pid>-<serial>and any fixtures left by interrupted tests survive every rerun and accumulate indefinitely, defeating the runner's documented clean-temp guarantee and potentially exhausting/tmpor contaminating later runs. Ensure these hashed roots are removed as part of each run or otherwise tie their lifetime to the per-leg directory.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #397 (merged as d25a9c6).
rstest.worker-isolation.tswrites an owner marker (.ab-rstest-owner.jsonwith pid + start time) into each hashed worker root, andscripts/local-ci.mjscalls the newscripts/rstest-worker-roots.mjsto remove only roots whose owner has exited — other lanes' live roots are never touched. Proven bytests/rstest-worker-isolation.test.ts; documented indocs/local-ci.md.