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

bazel: test scoped logs not directly available #74906

Closed
Tracked by #75453
RaduBerinde opened this issue Jan 17, 2022 · 5 comments
Closed
Tracked by #75453

bazel: test scoped logs not directly available #74906

RaduBerinde opened this issue Jan 17, 2022 · 5 comments
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. no-issue-activity

Comments

@RaduBerinde
Copy link
Member

RaduBerinde commented Jan 17, 2022

Many tests dump out their logs in separate files. When running under bazel, these logs are left in the sandbox which is removed (unless --debug_sandbox) is used.

I220117 05:35:34.291146 1 (gostd) rand.go:147  [-] 1  random seed: 6532117856687621002
test logs left over in: /home/radu/.cache/bazel/_bazel_radu/c5a4e7d36696d9cd970af2045211a7df/sandbox/linux-sandbox/1891/execroot/cockroach/_tmp/b287de7194e17a0386ee1775f0d198ba/logTestSchemaChangeReverseMutations4230933597
--- FAIL: TestSchemaChangeReverseMutations (0.91s)
    test_log_scope.go:79: test logs captured to: /home/radu/.cache/bazel/_bazel_radu/c5a4e7d36696d9cd970af2045211a7df/sandbox/linux-sandbox/1891/execroot/cockroach/_tmp/b287de7194e17a0386ee1775f0d198ba/logTestSchemaChangeReverseMutations4230933597
    test_log_scope.go:80: use -show-logs to present logs inline
    schema_changer_test.go:1788: pq: failed to construct index entries during backfill: unable to encode table key: <nil>
    panic.go:642: -- test log scope end --
FAIL
ls: cannot access '/home/radu/.cache/bazel/_bazel_radu/c5a4e7d36696d9cd970af2045211a7df/sandbox/linux-sandbox/1891/execroot/cockroach/_tmp/b287de7194e17a0386ee1775f0d198ba/logTestSchemaChangeReverseMutations4230933597': No such file or directory

Jira issue: CRDB-12316

@RaduBerinde RaduBerinde added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Jan 17, 2022
@rickystewart
Copy link
Collaborator

You should set --test_tmpdir=SOME_PERSISTENT_DIRECTORY, then your logs will be in SOME_PERSISTENT_DIRECTORY after the test runs.

@RaduBerinde
Copy link
Member Author

Good to knowm thanks. We need to find a way to convey this information.. even if we have to modify the message generated in test_log_scope.go.

Or, could we set this up by default in the repo's bazelrc? We could allow a gitignored testlogs directory.

@rickystewart
Copy link
Collaborator

Or, could we set this up by default in the repo's bazelrc?

I've only ever used this flag with an absolute path, not sure if it works with a relative path? You can give it a shot.

We already put the tmpdir in a special spot for --config ci, we would just have to make sure we don't break the existing stuff.

@irfansharif irfansharif self-assigned this Feb 16, 2022
@irfansharif irfansharif removed their assignment Apr 20, 2022
Copy link

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

@rickystewart
Copy link
Collaborator

./dev doctor guides you to set up your tmpdir appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. no-issue-activity
Projects
None yet
Development

No branches or pull requests

4 participants