Skip to content

Fix flaky overwriteSnapshotOnMaxPercentDiff test#2319

Open
greg7gkb wants to merge 1 commit intocashapp:masterfrom
greg7gkb:fix-flaky-overwrite-snapshot-test
Open

Fix flaky overwriteSnapshotOnMaxPercentDiff test#2319
greg7gkb wants to merge 1 commit intocashapp:masterfrom
greg7gkb:fix-flaky-overwrite-snapshot-test

Conversation

@greg7gkb
Copy link
Copy Markdown

Summary

  • overwriteSnapshotOnMaxPercentDiff had a copy-paste bug where recordLastModified was capturing dontRecordFile.lastModified() instead of recordFile.lastModified()
  • This caused a flaky assertion on CI: when both files share the same checkout timestamp (as they always do on a fresh git checkout), and the build completes within the same filesystem timestamp resolution, the isNotEqualTo check would spuriously fail
  • One-line fix: capture the correct file's timestamp

Test plan

  • Verify overwriteSnapshotOnMaxPercentDiff passes consistently across all platforms/JDK combos in CI

🤖 Generated with Claude Code

recordLastModified was incorrectly capturing dontRecordFile.lastModified()
instead of recordFile.lastModified(), causing a flaky assertion when both
files had the same checkout timestamp on CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant