-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
server: broken tests in bazel #61913
Comments
@rickystewart I looked into this today; I encounter the following error when I run the
Can you advise what to do? |
(FYI I am using bazel 4.0.0) |
I am able to work around the error above by commenting out the "patch" directives in Then I can reproduce the error (and I will be able to fix the broken test). Would still like to know what's wrong with the errorspb patch. |
@rickystewart I have investigated the failing tests further. There is something problematic in the way that bazel invokes the Go compiler or the test engine. Specifically, the file names for source files stored by the compiler/linker into the executable is different: they all include the This is problematic because these file names are used in multiple places inside the source code -- not just in tests. The fact the tests fail is not an indication that the test is broken; it's a positive signal (as the test was intended) that the binary was not built properly. I think we need to look at this first. |
I could perhaps investigate further if you could teach me how to run bazel verbosely, with details about which flags are passed to the |
The What configuration do we need to set to make sure the Let me open a bug for that |
I will use It's also possible that the |
One step further in the analysis, using the flags you recommended:
However I see that the final link stage is not done using the How is this program generated? |
I believe that's https://github.com/bazelbuild/rules_go/tree/master/go/tools/builders (see |
Thank you I'll start there and investigate further |
I found a much clearer symptom of the issue reported at top. Compare running the following command:
Using either a binary produced by With
With
The 2nd one is incorrect. |
I will fork this into a separate issue. |
Separate issue: #64379 - let's move the convo there. Once we solve that issue, I'll resume work on fixing the broken tests. |
See this comment: #64379 (comment) Until that separate issue is addressed, we may be able to alleviate the broken tests here by changing the logic to not rely on file paths as much. |
This works around an issue where Go source file names as stored in the `cockroach` binary were truncated (e.g., with the leading `github.com/cockroachdb/cockroach` prefix, or even the entire package name prefix, removed). This breaks unit tests (cockroachdb#61913) and some other internal stuff. We solve this by staging all Go source files during the build in a temporary directory named after the package. This incurs an additional I/O cost, but for now while our codebase isn't able to deal with the differing file names, we can deal with it. Fixes cockroachdb#64379 See also cockroachdb#64383 Release note: None
This works around an issue where Go source file names as stored in the `cockroach` binary were truncated (e.g., with the leading `github.com/cockroachdb/cockroach` prefix, or even the entire package name prefix, removed). This breaks unit tests (cockroachdb#61913) and some other internal stuff. We solve this by staging all Go source files during the build in a temporary directory named after the package. This incurs an additional I/O cost, but for now while our codebase isn't able to deal with the differing file names, we can deal with it. Fixes cockroachdb#64379 See also cockroachdb#64383 Release note: None
47413: kvserver/reports: handle joint-quorums r=andreimatei a=andreimatei See individual commits. 65094: bazel: stage all go source files in a temp dir named after the package r=rail,knz a=rickystewart This works around an issue where Go source file names as stored in the `cockroach` binary were truncated (e.g., with the leading `github.com/cockroachdb/cockroach` prefix, or even the entire package name prefix, removed). This breaks unit tests (#61913) and some other internal stuff. We solve this by staging all Go source files during the build in a temporary directory named after the package. This incurs an additional I/O cost, but for now while our codebase isn't able to deal with the differing file names, we can deal with it. Fixes #64379 See also #64383 Release note: None Co-authored-by: Andrei Matei <[email protected]> Co-authored-by: Ricky Stewart <[email protected]>
whoops :) |
@knz Gentle ping on this -- these are the last tests we're waiting for, so once they're fixed we can move on to more exciting stuff :) |
Hi Ricky, thanks for the reminder, and my apologies for the tardiness. |
We are making a lot of progress in the migration from make to Bazel. Before we can complete our migration, we need to make sure that all tests in-tree continue to pass when run inside of the Bazel sandbox. The following tests are broken when run in the Bazel sandbox:
Please help us by doing the following:
bazel test pkg/util/caller:caller_test
, and consult the test logs to see what went wrongbroken_in_bazel
tag from the test (see the linked documentation below)Helpful documentation:
The text was updated successfully, but these errors were encountered: