Open
Conversation
Run cleanup on a dedicated thread instead of the shared AgentTaskScheduler so testConcurrentCleanup is not queued behind cleanup tasks scheduled by other tests in the same JVM. Also fix a buggy assertion that masked cleanup failures, drop a dead visitFileFailed override, and minor cleanup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AlexeyKuznetsov-DD
approved these changes
Apr 30, 2026
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.
What Does This Do
Stops
TempLocationManagerTest.testConcurrentCleanupfrom depending on the sharedAgentTaskScheduler. Cleanup now runs on a dedicated thread owned by the test, with atry/finallythat always drains the worker on assertion failure.Also tightens the test suite:
testCleanup: replace the buggyassertFalse(rslt && Files.exists(...))(which silently passed when cleanup failed) with explicitassertTrue(rslt)+assertFalse(Files.exists(...)). Replace the fragile walk-up loop withTempLocationManager.getBaseTempDirName().testCleanup: route through the existing privateinstance(...)helper for consistency.testCleanupWithTimeout: drop the unreachablevisitFileFailedoverride (no@MethodSourceargument ever selects it).testConcurrentCleanup: hooks now return theCleanupHookdefault rather thannull, registerbaseDir.deleteOnExit(), and add anassertFalse(cleanupThread.isAlive())sanity check.Motivation
Recurring CI flake:
Cleanup thread should reach hook within 30 seconds expected: <true> but was: <false>. Root cause is the test's cleanup task being queued in the sharedAgentTaskSchedulerworker behind cleanup tasks scheduled by other tests in the same JVM.Additional Notes
Verified by running
testConcurrentCleanup5 times in a row locally — all green.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issue