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

test.xml missing when running flaky test #16351

Closed
exoson opened this issue Sep 29, 2022 · 1 comment
Closed

test.xml missing when running flaky test #16351

exoson opened this issue Sep 29, 2022 · 1 comment
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug

Comments

@exoson
Copy link
Contributor

exoson commented Sep 29, 2022

Description of the bug:

When running a flaky test with the --flaky_test_attempts=10 and --remote_download_minimal flags with remote execution, bazel build execution will stop if the test fails with the following error message:
ERROR: /data/repos/test_repo/BUILD:9:8: Testing //:python_test failed: unexpected I/O exception: /home/ekattainen/.cache/bazel/_bazel_ekattainen/f465db4dd2df63e33090e2c00fda9ac6/execroot/main/bazel-out/k8-fastbuild/testlogs/python_test/test.xml -> /home/ekattainen/.cache/bazel/_bazel_ekattainen/f465db4dd2df63e33090e2c00fda9ac6/execroot/main/bazel-out/k8-fastbuild/testlogs/python_test/test_attempts/attempt_1.xml (No such file or directory)

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Have a workspace with empty WORKSPACE file and BUILD and flaky_test.py files with following contents

$ cat BUILD
py_test(
    name = "flaky_test",
    srcs = "flaky_test.py",
)
$ cat flaky_test.py
import random
import sys

if random.random() > 0.5:
    sys.exit(1)

Run the following command until the test fails

$ bazel test //:python_test --nocache_test_results --config=remote_exec --flaky_test_attempts=4 --remote_download_minimal

The --config=remote_exec should configure bazel to execute the actions remotely.

Which operating system are you running Bazel on?

Ubuntu 20.04

What is the output of bazel info release?

development version

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

bazel build //src:bazel-bin

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

de02e3f62598dbe8dcff68b4040f34da3322c720
de02e3f62598dbe8dcff68b4040f34da3322c720

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

The culprit for this bug seems to be #16123 Tagging @coeuvre as the PR author if he were to come up with a quick fix.

@coeuvre
Copy link
Member

coeuvre commented Sep 29, 2022

Thanks for the report. I am able to reproduce this locally.

The fix is fairly easy though: we just need to override renameTo method in RemoteActionFileSystem. I will wait until #16283 is submitted because it makes lots of changes to RemoteActionFileSystem.

@coeuvre coeuvre self-assigned this Sep 29, 2022
@coeuvre coeuvre added type: bug P1 I'll work on this now. (Assignee required) team-Remote-Exec Issues and PRs for the Execution (Remote) team labels Sep 29, 2022
copybara-service bot pushed a commit that referenced this issue Oct 14, 2022
So that spawns within one action will be able to change the injected metadata using e.g. renameTo.

Also only allows metadata injection for declared action outputs instead of declared spawn outputs.

Related #16351.

Closes #16466.

PiperOrigin-RevId: 481099676
Change-Id: Idf1dc88956b3e68d2171c0e70203a8240200914a
coeuvre added a commit to coeuvre/bazel that referenced this issue Oct 17, 2022
coeuvre added a commit to coeuvre/bazel that referenced this issue Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-Remote-Exec Issues and PRs for the Execution (Remote) team type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants