-
Notifications
You must be signed in to change notification settings - Fork 74
Fix test handling of link timestamps. #2208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
PR HealthBreaking changes ✔️
This check can be disabled by tagging the PR with Coverage ✔️
This check for test coverage is informational (issues shown here will not fail the PR). This check can be disabled by tagging the PR with API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
This check can be disabled by tagging the PR with License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
This check can be disabled by tagging the PR with |
87aae85
to
55e5ce7
Compare
2e654d8
to
7e94f00
Compare
7e94f00
to
6571289
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm assuming review comment is addressed.
var mtime = mockFileModificationTimes[normalized]; | ||
return mtime != null ? DateTime.fromMillisecondsSinceEpoch(mtime) : null; | ||
}); | ||
addTearDown(() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wow, I didn't know this function existed. It's so handy. TIL!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, right? :)
|
||
File(fullPath).writeAsStringSync(contents); | ||
var file = File(fullPath); | ||
if (FileSystemEntity.typeSync(fullPath, followLinks: false) == |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment here explaining why this is necessary.
(You explained it nicely in the commit message, but someone reading the code shouldn't have to dig through git history to find it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, thanks. Done.
Revisions updated by `dart tools/rev_sdk_deps.dart`. ecosystem (https://github.com/dart-lang/ecosystem/compare/f4fbac4..6a8746e): 6a8746e 2025-10-13 Moritz Use newest verion of firehose in publish (dart-lang/ecosystem#378) http (https://github.com/dart-lang/http/compare/2c53fa3..2cb6c12): 2cb6c12 2025-10-15 Brian Quinlan chore(cronet_http): Prepare to release 1.6.0 (dart-lang/http#1833) a906598 2025-10-16 Denys Vitali fix(ok_http): trust manager init (dart-lang/http#1830) 54dfd63 2025-10-15 Brian Quinlan docs(cupertino_http): Clarify that happens when a request is cancelled (dart-lang/http#1834) 3e3c366 2025-10-15 Brian Quinlan chore(okhttp): Fix CI by setting minSdk=24 (dart-lang/http#1835) 6271faf 2025-10-13 Benjamin feat: export MediaType from http_parser (dart-lang/http#1803) 32dee0c 2025-10-13 Benjamin chore(cronet_http): bump compileSdkVersion to 34 (dart-lang/http#1832) tools (https://github.com/dart-lang/tools/compare/adf3fe7..f5920a2): f5920a2d 2025-10-16 Morgan :) Fix `PollingDirectoryWatcher` for delete during poll. (dart-lang/tools#2212) 289ba0d3 2025-10-15 Morgan :) Add DirectoryWatcher symlink tests. (dart-lang/tools#2206) 1275d4c3 2025-10-14 Kevin Moore Bump deps for graphs, html, process, pubspec_parse (dart-lang/tools#2210) 8b9a48ca 2025-10-14 Morgan :) Fix test handling of link timestamps. (dart-lang/tools#2208) 81588f32 2025-10-14 Abgar Simonean Update to oauth2 package README for Flutter Web info (dart-lang/tools#1961) webdev (https://github.com/dart-lang/webdev/compare/186bfe7..2517aa9): 2517aa94 2025-10-13 Srujan Gaddam [DWDS] Make pause a no-op on WebSocketProxyService (dart-lang/webdev#2697) Change-Id: Ifee5e199cf5799aa5962639e686192874f4d58b3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/455480 Auto-Submit: Devon Carew <devoncarew@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
I realized the "mock" timestamp handling in the
package:watcher
tests was not correctly accounting for links, which made the polling tests for links give wrong results.Various changes to address that.
enableMockModificationTimes
. The native watches don't use modification times so they can run entirely without "mock" times.And,
writeFile
had unintended behavior when there was a link: it would write through the link instead of replacing the link. Make it replace the file, and add checks towriteFile
,renameFile
andrenameLink
that the specified path ends up of the expected type.Update test expectations in link tests that were incorrect.
Test failures on MacOS on dev SDK are unrelated, they are due to an SDK issue dart-lang/sdk#61693