bazel: Rules_go tests are failing on Windows with Bazel 1.0
https://buildkite.com/bazel/rules-go-golang/builds/1491
Executing tests from //tests/legacy/examples/stamped_bin:stamped_test
-----------------------------------------------------------------------------
--- FAIL: TestBuild (1.83s)
stamped_test.go:101: Starting local Bazel server and connecting to it...
Server crashed during startup. Now printing c:\users\b\_bazel_b\ibnjdh6i\server\jvm.out
I/O Error: C:/users/b/_bazel_b/ibnjdh6i/server/server_info.rawproto.tmp -> C:/users/b/_bazel_b/ibnjdh6i/server/server_info.rawproto (Permission denied)
exit status 37
--- FAIL: TestBuildWithoutStamp (1.83s)
stamped_test.go:111: expected tests to have failed (instead got exit code 37)
FAIL
cleanup error: remove D:\b\jylqiqkr\bazel_testing\bazel_go_test\main: The process cannot access the file because it is being used by another process
Bazel 1.0 crashes inside the test due to some permission denied error.
We didn’t catch this in downstream test because the rules_go tests invoke bazel
from PATH
. On CI, it would actually be Bazelisk, but Bazelisk always points to the latest stable version instead of using Bazel@HEAD.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 23 (18 by maintainers)
Commits related to this issue
- Use FileSystemUtils.moveFile instead of renameTo function of Path renameTo is sometimes flaky on Windows, moveFile is a more robust implementation. Fixes https://github.com/bazelbuild/bazel/issues/9... — committed to bazelbuild/bazel by meteorcloudy 5 years ago
- Fixes #9995 Signed-off-by: Tomasz Strejczek <tomasz.strejczek@outlook.com> — committed to tomaszstrejczek/bazel by tomaszstrejczek 5 years ago
- Fix renameTo function on Windows Fixes https://github.com/bazelbuild/bazel/issues/9995 RELNOTES: None PiperOrigin-RevId: 274772226 — committed to luca-digrazia/DatasetCommitsDiffSearch by deleted user 2 years ago
- Automated rollback of commit 618e5a28f7f735c37724377b15775a4975349c74. *** Reason for rollback *** This operation is supposed to be atomic. The windows flakiness should be addressed more... — committed to luca-digrazia/DatasetCommitsDiffSearch by deleted user 2 years ago
I too can run bazel, you have to run an actual command, like build or clean.
Edit: clean seems to work though…
Edit 2: Hmm… after running clean, it seems like it is working again. I will keep investigating if it has something todo with first running 0.29.1, then 1.1.0
So currently, we set
USE_BAZEL_VERSION=D:\temp\tmpzmgcwe5d\bazel-bin\src\bazel.exe
for downstream pipeline. If you just invoke Bazel from path, Bazelisk will correctly invoke the bazel binary being tested. You don’t have to do anything now. 😃I have a stable reproduce locally and found a fix for this. Sending a CL now.