Skip to content
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

//src/test/shell/bazel:bazel_test_test does not pass #3727

Closed
jasharpe opened this issue Sep 12, 2017 · 4 comments
Closed

//src/test/shell/bazel:bazel_test_test does not pass #3727

jasharpe opened this issue Sep 12, 2017 · 4 comments
Assignees
Labels
breakage category: misc > testing P0 This is an emergency and more important than other current work. (Assignee required) type: bug

Comments

@jasharpe
Copy link

jasharpe commented Sep 12, 2017

Steps to reproduce:

cd $(mktemp -d) && \
git clone https://bazel.googlesource.com/bazel && \
cd bazel && \
bazel build //src:bazel && \
cp -f bazel-bin/src/bazel /tmp/test-bazel && \
/tmp/test-bazel test //src/test/shell/bazel:bazel_test_test --test_output=errors

Partial output (didn't copy the whole thing since it contains directory information):

test_flaky_test FAILED: Expected regexp PASS: //:flaky not found exactly once .
...
test_run_under_path FAILED: Expected failure .

Am I doing something wrong or are these tests broken at HEAD?

Platform: Ubuntu

@philwo
Copy link
Member

philwo commented Sep 13, 2017

I can repro this on my machine. Trying to find the culprit now.

@philwo philwo self-assigned this Sep 13, 2017
@philwo philwo added breakage category: misc > testing P0 This is an emergency and more important than other current work. (Assignee required) type: bug labels Sep 13, 2017
@philwo
Copy link
Member

philwo commented Sep 13, 2017

I couldn't find a single revision where this test actually passes. Weird.

@aehlig
Copy link
Contributor

aehlig commented Sep 14, 2017

@philwo 87cc92e is a good revision on FreeBSD (tested this several hundred times when trying to reproduce #3630).

bazel-io pushed a commit that referenced this issue Sep 20, 2017
…_DIR and TEST_UNDECLARED_OUTPUTS_ANNOTATIONS_DIR to Bazel.

After this change:

- Any files written to the TEST_UNDECLARED_OUTPUTS_DIR directory will be zipped up and added to an outputs.zip file under bazel-testlogs.

- Files will be listed in a MANIFEST file under bazel-testlogs.

- Any files written to TEST_UNDECLARED_OUTPUTS_ANNOTATIONS_DIR will be concatenated together into an ANNOTATIONS file under bazel-testlogs.

This provides a channel for tests to provide extra information outside of the test output itself. This is useful for things like verbose server logs.

Note: The //src/test/shell/bazel:bazel_test_test target has a pre-existing breakage (see #3727). But the new tests pass.

RELNOTES: Tests can now write files to TEST_UNDECLARED_OUTPUTS_DIR and TEST_UNDECLARED_OUTPUTS_ANNOTATIONS_DIR and these will be reflected under bazel-testlogs.
PiperOrigin-RevId: 169282528
@jasharpe
Copy link
Author

jasharpe commented Sep 22, 2017

I think I figured this out - the issue is that some .bazelrc file is leaking into the test. I happen to have on my machine a bazelrc in /etc/bazel.bazelrc that I believe causes the tests to fail because it enables the --experimental_ui flag (for test_flaky_test) and uses --test_env (I suspect for test_run_under_path).

The first-order fix is to just add --nomaster_bazelrc to some of the bazel invocations in test_run_under_path and test_flaky_test, which makes these tests work on my system again. Alternately, explicitly adding --noexperimental_ui also works for test_flaky_test.

Of course this ignores the issue that the tests won't be compatible with the new UI, which is another issue. And the deeper issue that tests should be more hermetic than this!

(I'm not entirely clear on the distinction between --master_bazelrc and --bazelrc, but only the master version is required to fix this test.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breakage category: misc > testing P0 This is an emergency and more important than other current work. (Assignee required) type: bug
Projects
None yet
Development

No branches or pull requests

3 participants