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

ci: improve test resilience and run style checks within cargo nextest #9608

Merged
merged 17 commits into from
Oct 2, 2023

Conversation

nagisa
Copy link
Collaborator

@nagisa nagisa commented Sep 28, 2023

I got absolutely fed up with waiting for prerequisite infrastructure work for #9290 (why does it have to be that hard?)

However the PR in question had some other important improvements that do not necessarily rely on changes to said infrastructure to work. In particular:

  • nextest now retries failing tests a few times before giving up, to make sure they aren't spuriously failing;
    • This should help some timing out integration tests in particular, as those often fail because of some deadlockish situation in my experience.
  • style checks still run with cargo nextest – unfortunately that means that in CI this will run these checks multiple times, but that doesn’t sound particularly terrible of a tradeoff (especially if the other changes mean we won't be retrying entire test suites as often anymore;)
  • This should allow for a greater portion of the test suite to run on Macs – unfortunately not verified by the CI, but people do complain and this should make the situation better.

cc #9367

This way running `cargo nextest` locally is the only thing you need to
do to figure out if there are going to be any issues with landing your
code.

One other reason is that running the tools locally the naive way will
clobber the build cache which can make iteration times slower.
When run on an m1 these can result in a very significant logging!
Checking clippy can take quite some time, and locally it is better to
spend some disk space for quick reruns over having to wait 2 minutes or
so before the test concludes.
It seems like we end up blocking on some directories sometimes, and
In particular a CI-specific profile that retries individual failing
tests a couple times before calling the entire CI run failing is a big
one as that will save on time for everybody even in presence of some
spurious tests that we have.

But also threads-required seems like a nice option to add to these
specific time intensive tests to hopefully reduce the duration of these
individual tests. I wonder if it also makes those heavy tests start in
the beginning of the run?
Land the remaining improvements while waiting for the infrastructure
setup to get completed.
This will mean that some tests will run multiple times until
infrastructure can be changed...
@nagisa nagisa requested review from wacban and akhi3030 September 28, 2023 07:48
@nagisa nagisa requested a review from a team as a code owner September 28, 2023 07:48
Cause CI scripts can't be changed…
I anticipate that changing the script will not let the CI run…
@nagisa
Copy link
Collaborator Author

nagisa commented Oct 2, 2023

@nikurt @Longarithm could I request a review here?

}

#[test]
fn clippy() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function duplicates scripts/run_clippy.sh. I see that you plan to delete that file in #9290.
Should be fine, but maybe add a TODO to remove the duplicated files.

@@ -31,24 +31,24 @@ fn setup_subscriber_from_filter(mut env_filter: EnvFilter) {
}

pub fn init_test_logger() {
let env_filter = EnvFilter::new("tokio_reactor=info,tokio_core=info,hyper=info,debug");
let env_filter = EnvFilter::new("cranelift=warn,wasmtime=warn,h2=warn,tower=warn,trust_dns=warn,tokio_reactor=info,tokio_core=info,hyper=info,debug");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -117,7 +117,7 @@ impl<S: Subscriber + for<'span> LookupSpan<'span>> Layer<S> for IoTraceLayer {
}
}

#[allow(clippy::integer_arithmetic)]
#[allow(clippy::arithmetic_side_effects)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also update docs/practices/style.md

285:`clippy::integer_arithmetic` lints.

@nagisa nagisa added this pull request to the merge queue Oct 2, 2023
Merged via the queue into master with commit 90fb333 Oct 2, 2023
@nagisa nagisa deleted the nagisa/cargo-tests-style-excerpt branch October 2, 2023 10:26
nikurt pushed a commit that referenced this pull request Oct 2, 2023
…t` (#9608)

I got absolutely fed up with waiting for prerequisite infrastructure
work for #9290 (why does it have to be _that_ hard?)

However the PR in question had some other important improvements that do
not necessarily *rely* on changes to said infrastructure to work. In
particular:

* `nextest` now retries failing tests a few times before giving up, to
make sure they aren't spuriously failing;
* This should help some timing out integration tests in particular, as
those often fail because of some deadlockish situation in my experience.
* style checks still run with `cargo nextest` – unfortunately that means
that in CI this will run these checks multiple times, but that doesn’t
sound particularly terrible of a tradeoff (especially if the other
changes mean we won't be retrying entire test suites as often anymore;)
* This should allow for a greater portion of the test suite to run on
Macs – unfortunately not verified by the CI, but people do complain and
this should make the situation better.

cc #9367
nikurt pushed a commit that referenced this pull request Oct 2, 2023
…t` (#9608)

I got absolutely fed up with waiting for prerequisite infrastructure
work for #9290 (why does it have to be _that_ hard?)

However the PR in question had some other important improvements that do
not necessarily *rely* on changes to said infrastructure to work. In
particular:

* `nextest` now retries failing tests a few times before giving up, to
make sure they aren't spuriously failing;
* This should help some timing out integration tests in particular, as
those often fail because of some deadlockish situation in my experience.
* style checks still run with `cargo nextest` – unfortunately that means
that in CI this will run these checks multiple times, but that doesn’t
sound particularly terrible of a tradeoff (especially if the other
changes mean we won't be retrying entire test suites as often anymore;)
* This should allow for a greater portion of the test suite to run on
Macs – unfortunately not verified by the CI, but people do complain and
this should make the situation better.

cc #9367
nikurt pushed a commit that referenced this pull request Oct 11, 2023
…t` (#9608)

I got absolutely fed up with waiting for prerequisite infrastructure
work for #9290 (why does it have to be _that_ hard?)

However the PR in question had some other important improvements that do
not necessarily *rely* on changes to said infrastructure to work. In
particular:

* `nextest` now retries failing tests a few times before giving up, to
make sure they aren't spuriously failing;
* This should help some timing out integration tests in particular, as
those often fail because of some deadlockish situation in my experience.
* style checks still run with `cargo nextest` – unfortunately that means
that in CI this will run these checks multiple times, but that doesn’t
sound particularly terrible of a tradeoff (especially if the other
changes mean we won't be retrying entire test suites as often anymore;)
* This should allow for a greater portion of the test suite to run on
Macs – unfortunately not verified by the CI, but people do complain and
this should make the situation better.

cc #9367
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants