Add tests proving queue cleanup on timeout and hard-kill#1019
Open
mPokornyETM wants to merge 5 commits intomasterfrom
Open
Add tests proving queue cleanup on timeout and hard-kill#1019mPokornyETM wants to merge 5 commits intomasterfrom
mPokornyETM wants to merge 5 commits intomasterfrom
Conversation
9b86fef to
0a0afcb
Compare
Adds LockStepTimeoutQueueTest with 5 tests that verify the lock queue is properly cleaned up when builds are timed out, aborted, or hard-killed while waiting for a lockable resource: - timeoutWhileWaitingForLockClearsQueue: timeout step wrapping lock - abortWhileWaitingForLockByLabelClearsQueue: executor.interrupt() - timeoutMiddleBuildInQueuePreservesOrder: FIFO order preserved - hardKillWhileWaitingForLockClearsQueueViaIsValid: doKill() with multiple waiters — isValid() fallback removes stale queue entry - hardKillOnlyWaiterDoesNotBlockFutureBuilds: doKill() sole waiter All tests pass, confirming the lockable-resources plugin correctly handles both the clean stop() path and the isValid() fallback path. Fixes #773
0a0afcb to
2b916aa
Compare
Contributor
|
⏸️ Auto-merge countdown PAUSED: CI checks are not passing. The countdown will resume when all checks are green. |
2b916aa to
5381608
Compare
Adds LockStepTimeoutQueueTest with 5 tests that verify the lock queue is properly cleaned up when builds are timed out, aborted, or hard-killed while waiting for a lockable resource: - timeoutWhileWaitingForLockClearsQueue: timeout step wrapping lock - abortWhileWaitingForLockByLabelClearsQueue: executor.interrupt() - timeoutMiddleBuildInQueuePreservesOrder: FIFO order preserved - hardKillWhileWaitingForLockClearsQueueViaIsValid: doKill() with multiple waiters — isValid() fallback removes stale queue entry - hardKillOnlyWaiterDoesNotBlockFutureBuilds: doKill() sole waiter All tests pass, confirming the lockable-resources plugin correctly handles both the clean stop() path and the isValid() fallback path. Fixes #773
5381608 to
37cfc7a
Compare
Contributor
|
⏳ Auto-merge countdown: This PR will be auto-approved in 2 day(s) if no review is submitted. |
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.
Summary
Adds LockStepTimeoutQueueTest with 5 tests that exhaustively verify the lock queue is properly cleaned up when builds are timed out, aborted, or hard-killed while waiting for a lockable resource.
Tests
timeoutstep wrappinglock— cleanstop()pathexecutor.interrupt()on label-based lockdoKill()with multiple waiters —isValid()fallback removes stale queue entrydoKill()sole waiter — future builds can still acquire the lockAnalysis of #773
The reported scenario involves a parent pipeline with a
timeoutthat triggers downstream jobs via thebuild()step. When the parent times out:Direct
lock()insidetimeout(): works correctly.LockStepExecution.stop()callsunqueueContext()which removes the waiting entry from the queue. This is covered by the first 3 tests.Hard kill (extreme prejudice): also works correctly. Even when
stop()is bypassed, theisValid()check ingetNextQueuedContext()detects that the killed build is no longer running and removes the stale queue entry when another resource is freed. This is covered by the last 2 tests.Cross-build propagation (the actual Resources are not removed from queue, when timeout is reached #773 scenario): when a parent pipeline times out and kills the
build()step, the downstream build may continue running independently because build cancellation propagation is handled by thepipeline-build-stepplugin, notlockable-resources. The downstream build's lock queue entry is valid (the build IS still running), so lockable-resources correctly keeps it queued.Conclusion
The lockable-resources plugin correctly handles all timeout/abort/kill scenarios for its own queue. The issue described in #773 is a cross-plugin concern where
pipeline-build-stepdoes not propagate the parent's timeout cancellation to the downstream build.Fixes #773