Fixes a flake in reload shaders tests#184268
Fixes a flake in reload shaders tests#184268gaaclarke wants to merge 2 commits intoflutter:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request modifies shader_reload_test.dart by introducing a _deleteAndWrite helper function to update shader files, intended to prevent the engine from accessing memory-mapped files during truncation. A review comment suggests using an atomic write pattern with a temporary file and rename operation to eliminate a potential race condition where the file is briefly non-existent.
b-luk
left a comment
There was a problem hiding this comment.
LGTM, but I wonder why Gemini's suggestion doesn't work. From your error message, it looks like the move fails because the temp file doesn't exist. I wouldn't expect that to error to happen.
Yea, that was a surprise to me too. Maybe we should file a Dart bug. I shouldn't have to accommodate for this at the app layer if I'm writing synchronously and flushing. |
|
I'm lead to believe this is somehow related to using mmap. Maybe that bypasses some filesystem synchronization that happens. |
|
autosubmit label was removed for flutter/flutter/184268, because - The status or check suite Linux linux_unopt has failed. Please fix the issues identified (or deflake) before re-applying this label. |
fixes #184265
This fixes an oddity related to mmap files. A delay had to be introduced in the test because of oddities with the filesystem. I tried a few tricks to get it to work without the delay but this is the only way I could get it to work.
testing: has existing test, removes a flake
I tested it manually locally:
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.