Repository navigation
Fix flaky Hub web service lock test - #13
Merged
Merged
Conversation
service_lock relied on closing its fd to release the flock. A flock belongs to the open file description, which a child forked by another test thread shares until exec closes its O_CLOEXEC copy, so the lock could outlive the drop and web_service_lock_is_exclusive_and_released_on_drop failed intermittently. Return a guard that unlocks with LOCK_UN on drop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DigitalPals
force-pushed
the
fix/ci-android-hub-lock
branch
from
November 6, 2026 10:04
0f25577 to
c1138f9
Compare
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 the intermittent Hub Runtime failure in
runtime::tests::web_service_lock_is_exclusive_and_released_on_drop.Cause:
service_lockreleased itsflockonly by closing the file. Aflockbelongs to the open file description, and a child that another test thread is forking shares that description until itsexeccloses theO_CLOEXECcopy. So for that short window, the lock survived the drop and relocking failed. Fixture paths were already unique, so they weren't the cause.Fix:
service_locknow returns aServiceLockguard that callsflock(LOCK_UN)on drop, so the lock is released immediately. The test is unchanged.The Android
platform-toolsfix that this PR first carried landed on main in #9 in identical form. That PR also pins the amd64 Hub runner toubuntu-24.04, which fixes the separate Tailscale/iptables step failure. This branch is rebased onto it.Verification (local, project dev shell):
cargo test -p portal-hub web_service_lock×60: all passed.cargo test -p portal-hub: all passed, before and after the rebase.cargo fmt --checkandcargo clippy -p portal-hub --all-targets -D warningsare clean.🤖 Generated with Claude Code