facebook/watchman

`test_clock_sync` seems flaky

marianosimone opened this issue · 0 comments

This is similar to [watchman/issues/1100] test_sinceRelativeRoot seems flaky

I'm trying to build from source, and I keep getting flaky results on

self.assertNotEqual(clock1, clock2)

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:

root = self.mkdtemp()
self.watchmanCommand("watch", root)
clock1 = self.watchmanCommand("clock", root, {"sync_timeout": 5000})
self.assertRegex(clock1["clock"], "^c:\\d+:\\d+:\\d+:\\d+$")
clock2 = self.watchmanCommand("clock", root, {"sync_timeout": 5000})
self.assertRegex(clock2["clock"], "^c:\\d+:\\d+:\\d+:\\d+$")

can flake if not enough time passes between the assignment to clock1 and the clock2?