Repository navigation
test: Wait for the failure status in the file synchronizer pins, so they hold on Windows - #260
kinyoklion wants to merge 1 commit into
Conversation
…hey hold on Windows On Windows a rewrite with Files.write produces two file system events, and the legacy synchronizer reloads after each. The reload after the truncation reads the empty file as an empty document and delivers a change set before the malformed content is reported. The two pins that asserted the first result was the STATUS now consume results until the STATUS arrives.
8cda80f to
d63a9a0
Compare
b3e3725 to
83375f8
Compare
There was a problem hiding this comment.
Stale comment
Risk: low.
Automated risk review (dry run): Low
This PR would be automatically approved.
Why: The diff only updates
FileSynchronizerReloadBehaviorTest.javaso two reload-failure pins wait for the first STATUS after a Windows double WatchService event, with no production, infra, or CI workflow changes.If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.
Sent by Cursor Approval Agent: Dry-Run PR Approver
There was a problem hiding this comment.
Automated risk review (dry run): Low
This PR would be automatically approved.
Why: The only change is in FileSynchronizerReloadBehaviorTest.java, a test helper that waits for the first STATUS result so Windows dual WatchService events do not fail existing pins. No production, infrastructure, auth, or CI files are modified.
Sent by Cursor Approval Agent: Dry-Run PR Approver


Update, 2026-11-13
feat/overrides, which now includes feat: Add the overrideAffected indicator to EvaluationReason #218 and feat: Count override-affected evaluations separately and send no individual events for them #219 and hasmainmerged into it. Frommainit gets the 7.18.0 release, CI on the latest v3 contract tests, flag change listener support in the contract test service, and thejava-sdk-internal1.12.1 and 1.12.2 fixes. A common 2.6.0 and internal 1.13.0 release from this branch needs those fixes.commonandinternalpublished locally fromfeat/overrides:Requirements
Related issues
This resolves Finding 1 of the Windows stability assessment for the Java overrides work: plans/java-overrides-windows-test-stability.md in sdk-scratchpad.
It is stacked on #259, the top of the overrides stack, so the PRs below it do not change.
Describe the solution you've provided
#220 added
FileSynchronizerReloadBehaviorTest. It pins how the legacy file data synchronizer reloads: on every file system event, reporting every failure, without retrying. On Windows, two of its tests fail every time; on Linux they pass:everyFailedReloadIsReportedAndLoggedAsThePlainDescriptionfailedReloadIsNotRetriedWithoutAFileChangeWhy they fail on Windows:
Files.write, which truncates the file and then writes it.WatchServicekeys, and the legacy synchronizer reloads after each.STATUS, so they received the change set instead.A new helper,
awaitStatus, consumes results until the firstSTATUSarrives, within the existing timeout. The three assertions that waited on the next result now use it. On Linux, the first result is still theSTATUS. The pins still describe the legacy behavior they set out to pin: the failure is reported, each failure is logged as the plain description, and nothing retries without a file change.To reproduce the Windows sequence on Linux, I made a scratch copy of the test that empties the file, waits 300 ms, and then writes the malformed content. Both pinned tests fail with the old assertions and pass with this change. The whole class passes on Linux as written. The file data, file synchronizer and file override test classes pass (144 tests), and
checkstyleTestis clean. I did not run this on Windows. java-core CI runs on Linux only.Describe alternatives you've considered
Writing the malformed content to a temporary file and moving it into place, which is one event on both platforms. That would pin a different writer than the one the tests describe.
Additional context
Not in this PR:
main, outside the overrides work. On Windows, every in-place rewrite of a legacy file data source's file briefly applies an empty data set: all flags are gone and defaults are served until the next reload. The assessment recommends a minimal fix: treat an empty file as a failed load, which keeps the last data. That changes the legacy data sources, so it belongs in its own PR againstmain.main:Opened from termag
Note
Overview
Adds an
awaitStatushelper inFileSynchronizerReloadBehaviorTestthat drains synchronizer futures until the firstSTATUSresult, within the existing timeout.everyFailedReloadIsReportedAndLoggedAsThePlainDescriptionandfailedReloadIsNotRetriedWithoutAFileChangenow useawaitStatusinstead of assuming the next result after a malformed rewrite is immediately a failure status. On Windows, in-place writes can emit an extra reload (empty file → change set) before the malformed-contentSTATUS, which was breaking those pins; Linux behavior is unchanged whenSTATUSis already first.Reviewed by Cursor Bugbot for commit d63a9a0. Bugbot is set up for automated code reviews on this repo. Configure here.