facebook / watchman

Watches files and records, or triggers actions, when they change.
https://facebook.github.io/watchman/
MIT License
12.65k stars 992 forks source link

`test_sinceRelativeRoot` seems flaky #1100

Closed marianosimone closed 1 year ago

marianosimone commented 1 year ago

I'm trying to build from source, and I keep getting flaky results on https://github.com/facebook/watchman/blob/0b238b069f54a4de27c35a3e2352c37bccc12d60/watchman/integration/test_since.py#L90

While debugging, I added some log lines, and it immediately stopped flaking (Heisenbug flag!)

I haven't fully looked into the implementation to understand this 100%, but could it be that:

https://github.com/facebook/watchman/blob/0b238b069f54a4de27c35a3e2352c37bccc12d60/watchman/integration/test_since.py#L78-L89

can flake if not enough time passes between the assignment to clock and the query?

I've locally patched this to mock the clock with an older time, and it stopped flaking

fanzeyi commented 1 year ago

Thanks for reporting. Yes I think this particular test is flakey even in our internal CI. We haven't really gotten the time to sit down and debug this.

If you like you are welcome to send us your local patch and we can get it merged.

marianosimone commented 1 year ago

I have a proposed fix in [watchman/pr/1103] 🐛 Fix flaky test_sinceRelativeRoot