-
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
dev: override bazel timeout when run under stress #72046
dev: override bazel timeout when run under stress #72046
Conversation
When running under stress and no timeout is specified, we want to respect the timeout passed down to stress[^1]. Not doing so has bazel default to a timeout based on the test target's size[^2], which is not what we want. [^1]: Through --stress-arg=-maxtime or if nothing is specified, a -maxtime of 0 that's taken as "run forever") [^2]: https://docs.bazel.build/versions/main/test-encyclopedia.html#role-of-the-test-runner Release note: None
Aside: I see we ripped out the automatic recording stuff in #68514, but the datadriven tests here still consults these files. I had to edit them by hand, which I stumbled with expecting
I'm curious what we're imagining a proper mocking framework for dev to look like? And what would it give us over using recordings in the way we were before? |
Yeah, the recording wasn't useful. It introduced so many diffs that heavy manual editing of the
For example, a limitation of the current design is that the recording framework doesn't allow us to capture that certain events should fail, which means we can't test edge/failure cases with the datadriven tests. |
That sounds surprising and was probably a bug if anything. The intent was that
We use datadriven tests to test failure cases all throughout our logic tests, etc, and I think it's particularly well suited for it too. Here are some examples of us doing just that: cockroach/pkg/cli/testdata/logflags Lines 363 to 368 in 31e7416
It's ends up being a matter of writing the error output in way that's distinguishable from the happy path, which the recorder didn't do, but I think it's a minor change to make. |
bors r+ |
Build failed (retrying...): |
Build succeeded: |
When running under stress and no timeout is specified, we want
to respect the timeout passed down to stress1. Not doing so has bazel
default to a timeout based on the test target's size2, which is not
what we want.
Release note: None
Footnotes
Through --stress-arg=-maxtime or if nothing is specified, a
-maxtime of 0 that's taken as "run forever") ↩
https://docs.bazel.build/versions/main/test-encyclopedia.html#role-of-the-test-runner ↩