commit | da0963ad8468c188ec12b9d9a0bf60c006866443 | [log] [tgz] |
---|---|---|
author | jmmv <jmmv@google.com> | Thu Feb 27 11:37:00 2020 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Feb 27 11:38:10 2020 -0800 |
tree | 1bbbda9c680bf2f40897e1b0f5909d902fb80203 | |
parent | 8ce7fd1222cf3f9f5fc487d774b96cbaf89b999a [diff] |
Fix an initialization race in MacOSXFsEventsDiffAwareness and reenable tests. MacOSXFsEventsDiffAwareness creates a thread at initialization time to run the fsevents loop. This process takes two steps: first, registering the fsevents queue with the kernel, which determines the point in time from which we want to receive events; and, second, the actual start of the run loop. Before returning from init(), we must ensure we have at least completed the first step of waiting for the queue registration -- or else any file system operations that happen before the registration are lost. I thought about splitting the run() method in two parts instead of using a latch for synchronization but that doesn't work: note that the "run" part of the loop relies on the current thread's CFRunLoop, which is different from the one we'd do in the preparatory step outside of the thread. Tested: Added a sleep in the thread right before we call run(). Without this fix, we consistently lose all events from the test, and with this fix, we get them all. Fixes #10776. RELNOTES: None. PiperOrigin-RevId: 297648494
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
See CONTRIBUTING.md