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

Update ui test crate #11239

Merged
merged 7 commits into from
Aug 11, 2023
Merged

Update ui test crate #11239

merged 7 commits into from
Aug 11, 2023

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jul 27, 2023

This update also removes the //@run-rustfix flag, and just runs rustfix on all tests. This means I had to opt out of running rustfix on ~100 tests, but it also allowed me to remove the rustfix coverage check entirely, as it is now effectively builtin.

changelog: update ui-test crate to 0.13 (automatically runs rustfix on all tests)

@rustbot
Copy link
Collaborator

rustbot commented Jul 27, 2023

r? @Alexendoo

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 27, 2023
@Alexendoo Alexendoo added S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Jul 28, 2023
@bors
Copy link
Collaborator

bors commented Jul 28, 2023

☔ The latest upstream changes (presumably #11250) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk
Copy link
Contributor Author

oli-obk commented Aug 3, 2023

If you want to try out the new progress bar feature, use cargo test -- -- --quiet.

A notable difference (without --quiet) to before this PR is that the test names are now printed immediately, but the ok part after the ... is only printed when the test actually finishes.

@oli-obk
Copy link
Contributor Author

oli-obk commented Aug 3, 2023

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work labels Aug 3, 2023
@oli-obk
Copy link
Contributor Author

oli-obk commented Aug 3, 2023

Ok, actually ready now 🙃

@bors
Copy link
Collaborator

bors commented Aug 6, 2023

☔ The latest upstream changes (presumably #10843) made this pull request unmergeable. Please resolve the merge conflicts.

@Alexendoo
Copy link
Member

This fails to run on my laptop, it hits

thread '<unnamed>' panicked at 'could not execute "/home/alex/rust/clippy/target/debug/clippy-driver" ...: Too many open files (os error 24)', /home/alex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ui_test-0.13.0/src/lib.rs:620:35
...
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', /home/alex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ui_test-0.13.0/src/status_emitter.rs:255:54

It's 2 cores/2 threads so it's not running much in parallel, it seems to be opening a growing number of pipes according to lsof so there may be a leak somewhere. My ulimit -n is apparently 1024 which is surprisingly small

@oli-obk
Copy link
Contributor Author

oli-obk commented Aug 7, 2023

I fixed the pipe leak (i'll bump the minor version of ui test in the Cargo.toml here to pull it in), but miri has the same issue for low thread/process limits.

Part of the problem seems to be, that it's per process tree, not per process. So all the clippy processes running at the same time seem to be sharing a single limit.

@bors
Copy link
Collaborator

bors commented Aug 8, 2023

☔ The latest upstream changes (presumably #11305) made this pull request unmergeable. Please resolve the merge conflicts.

@Alexendoo
Copy link
Member

Nice, runs fine now

I've noticed it's quite a bit slower, measuring it with:

hyperfine -L commit 7c595b4599d546dc5f36bc4bebbbf8ad454fed62,ui_test \
    --prepare 'git checkout {commit}' \
    --warmup 2 \
    -n '{commit}' \
    'cargo uitest'

x86_64-pc-windows-msvc, 6 cores/12 threads

Benchmark 1: 7c595b4599d546dc5f36bc4bebbbf8ad454fed62
  Time (mean ± σ):     18.325 s ±  0.296 s    [User: 113.464 s, System: 59.451 s]
  Range (min … max):   17.899 s … 18.837 s    10 runs

Benchmark 2: ui_test
  Time (mean ± σ):     24.262 s ±  0.041 s    [User: 61.322 s, System: 39.990 s]
  Range (min … max):   24.208 s … 24.332 s    10 runs

Summary
  '7c595b4599d546dc5f36bc4bebbbf8ad454fed62' ran
    1.32 ± 0.02 times faster than 'ui_test'

aarch64-unknown-linux-gnu, 4 cores/4 threads

Benchmark 1: 7c595b4599d546dc5f36bc4bebbbf8ad454fed62
  Time (mean ± σ):     55.910 s ±  0.233 s    [User: 146.823 s, System: 58.316 s]
  Range (min … max):   55.658 s … 56.372 s    10 runs
 
Benchmark 2: ui_test
  Time (mean ± σ):     85.066 s ±  0.091 s    [User: 97.486 s, System: 48.101 s]
  Range (min … max):   84.942 s … 85.243 s    10 runs
 
Summary
  '7c595b4599d546dc5f36bc4bebbbf8ad454fed62' ran
    1.52 ± 0.01 times faster than 'ui_test'

@oli-obk
Copy link
Contributor Author

oli-obk commented Aug 9, 2023

I'll investigate, but I won't get to that in the next few weeks as I'm going on vacation starting this weekend.

@oli-obk
Copy link
Contributor Author

oli-obk commented Aug 10, 2023

looks like there were two separate regressions:

  add2722677412c40cb4ef41ac46ede4792442f4d (commit = add2722677412c40cb4ef41ac46ede4792442f4d) ran
    1.06 ± 0.01 times faster than b401c422f22470822f84111d400579b3689b84cd (commit = b401c422f22470822f84111d400579b3689b84cd)
    1.84 ± 0.01 times faster than 7b194241530c7d8cbd7f677d587e3a86e0340114 (commit = 7b194241530c7d8cbd7f677d587e3a86e0340114)
    2.73 ± 0.02 times faster than 17d39fda8312f667a2151d8c03b2d8cba1ec435e (commit = 17d39fda8312f667a2151d8c03b2d8cba1ec435e)
    2.73 ± 0.02 times faster than ui_test (commit = ui_test)

@oli-obk
Copy link
Contributor Author

oli-obk commented Aug 10, 2023

The performance issue has been found and resolved.

@bors
Copy link
Collaborator

bors commented Aug 11, 2023

☔ The latest upstream changes (presumably #11318) made this pull request unmergeable. Please resolve the merge conflicts.

@Alexendoo
Copy link
Member

Very nice, it's now faster than the current version

Windows
  'ui_test' ran
    1.42 ± 0.03 times faster than 'add2722677412c40cb4ef41ac46ede4792442f4d'

Linux aarch64
  'ui_test' ran
    1.40 ± 0.01 times faster than 'add2722677412c40cb4ef41ac46ede4792442f4d'

@bors
Copy link
Collaborator

bors commented Aug 11, 2023

📌 Commit 3d3856f has been approved by Alexendoo,flip1995

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Aug 11, 2023

⌛ Testing commit 3d3856f with merge a40940d...

bors added a commit that referenced this pull request Aug 11, 2023
Update ui test crate

This update also removes the `//`@run-rustfix`` flag, and just runs rustfix on all tests. This means I had to opt out of running rustfix on ~100 tests, but it also allowed me to remove the rustfix coverage check entirely, as it is now effectively builtin.

changelog: update ui-test crate to 0.13 (automatically runs rustfix on all tests)
@bors
Copy link
Collaborator

bors commented Aug 11, 2023

💔 Test failed - checks-action_test

@oli-obk
Copy link
Contributor Author

oli-obk commented Aug 11, 2023

hmm... the mac os test runner passes --skip, which ui_test doesn't know about. I'll see if I can get an implementation of it done quickly.

thread 'main' panicked at tests/compile-test.rs:120:29:
called `Result::unwrap()` on an `Err` value: unknown command line flag `--skip`

@oli-obk
Copy link
Contributor Author

oli-obk commented Aug 11, 2023

Ready again. I also checked (manually) and haven't found any other flags being used in clippy CI

@flip1995
Copy link
Member

@bors r=Alexendoo,flip1995

@bors
Copy link
Collaborator

bors commented Aug 11, 2023

📌 Commit 665a619 has been approved by Alexendoo,flip1995

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Aug 11, 2023

⌛ Testing commit 665a619 with merge 739faf3...

@bors
Copy link
Collaborator

bors commented Aug 11, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Alexendoo,flip1995
Pushing 739faf3 to master...

@bors bors merged commit 739faf3 into rust-lang:master Aug 11, 2023
7 checks passed
bors added a commit that referenced this pull request Aug 13, 2023
Do not bless by default in ui tests

This restores the default behaviour to check the `.stderr`, it was changed in #11239 to bless by default in `cargo test` (unless in github actions), but check by default in `cargo uitest` which is fairly confusing

It also meant `cargo uitest -F internal` no longer worked

`--bless` prevents the use of `Args::test` but we can look at reintegrating with that after `@oli-obk's` vacation

r? `@flip1995`

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants