test(build-driver): the work-folder removal test waits out a lock another test's child still holds for a moment #2534
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2534
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:push-vqrtyovmxmnp"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
layout::tests::a_work_folder_goes_whole_unless_a_build_holds_itfailed once in a fullcargo testrun of the workspace, then passed alone. The cause:File::try_lockisflock, which belongs to the open file. When another test in the same process forks a child at that moment, the child holds the lock's file until its exec closes it. So the lock outlivesdrop(held)for a moment, andremove_worksees the folder still held.The test now retries
remove_workfor up to 5 s after letting go of the lock. Only the test changes: a builder never forks while it removes a work folder it held itself. Readbuilder/crates/build-driver/src/layout.rs, the test.Testing
Tested: Linux (CachyOS),
cargo test -p build-driver --lib a_work_folder_goes_wholepasses. The change is in a#[cfg(test)]module, so no game run applies (opened with--forceat the maintainer's request).Still to test: None.
Measurements
Nothing to measure: the change is in a test only.
Risks
None for players: test code only. If the retry hid a real failure to remove the folder, the test still fails after 5 s.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (not yet run: queued with the next batched build-mode job)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Possibly related, for context:
WIP: test(build-driver): the work-folder removal test waits out a lock another test's child still holds for a momentto test(build-driver): the work-folder removal test waits out a lock another test's child still holds for a moment