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

Migrate libtest-thread-limit run-make test to rmake #128507

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

Oneirical
Copy link
Contributor

@Oneirical Oneirical commented Aug 1, 2024

Part of #121876 and the associated Google Summer of Code project.

Please try, but only if normal CI is green:

// try-job: armhf-gnu // <- failed on this
try-job: aarch64-gnu

@rustbot
Copy link
Collaborator

rustbot commented Aug 1, 2024

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 1, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 1, 2024

This PR modifies tests/run-make/. If this PR is trying to port a Makefile
run-make test to use rmake.rs, please update the
run-make port tracking issue
so we can track our progress. You can either modify the tracking issue
directly, or you can comment on the tracking issue and link this PR.

cc @jieyouxu

@rust-log-analyzer

This comment has been minimized.

@Oneirical
Copy link
Contributor Author

ulimit was not found? How is that possible, if the original test uses it and passes...

@jieyouxu
Copy link
Member

jieyouxu commented Aug 2, 2024

ulimit was not found? How is that possible, if the original test uses it and passes...

Argh, you see the $(shell ulimit)? ulimit is a shell command implemented by the shell, not a separate program...

ulimit provides control over the resources available to the shell and to processes started by it, on systems that allow such control.

See bash(1) and search for ulimit and its -p flag.

In particular, the -p flag is to specify

the pipe size in 512-byte blocks (this may not be set)

@jieyouxu
Copy link
Member

jieyouxu commented Aug 2, 2024

Also note that the -p flag on ulimit means different things depending on which shell is used, it's pipe size for bash but process limit for dash...

@bors
Copy link
Contributor

bors commented Aug 2, 2024

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

@jieyouxu
Copy link
Member

jieyouxu commented Aug 2, 2024

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 2, 2024
@Oneirical Oneirical force-pushed the testart-from-scratch branch from 5602322 to 97485af Compare August 5, 2024 17:25
@rustbot
Copy link
Collaborator

rustbot commented Aug 5, 2024

The run-make-support library was changed

cc @jieyouxu

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@Oneirical Oneirical force-pushed the testart-from-scratch branch from 97485af to cd3fe6d Compare August 5, 2024 17:25
@Oneirical
Copy link
Contributor Author

@rustbot review

This feels like progress, but it feels as if every possible permutation of 0 and 1 in all 3 arguments result in either a test failure or a coredump.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 5, 2024
@rust-log-analyzer

This comment has been minimized.

@jieyouxu
Copy link
Member

jieyouxu commented Aug 7, 2024

I'm stuck on this libtest one as well, so I'm asking for help in #t-libs.

@rustbot blocked (waiting for elp)

images

@rustbot rustbot added S-blocked Status: 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 Aug 7, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Aug 8, 2024

In https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Problem.20porting.20.60tests.2Frun-make.2Flibtest-thread-limit.60:

  • The test.rs is always going to fail, because libtest upon thread exhaustion (failure to spawn new threads) will attempt (after that PR which introduced the test) to run the tests sequentially, in alphabetical test name order, meaning that spawn_thread_would_block which sets THREAD_ID will be executed after run_in_same_thread, causing the test to always fail.
  • We don't need such execution order guarantee or that they even run on the same exact thread, we just want libtest to not crash here due to inability to spawn new threads. Thus, we can just have two empty tests:
#[test] fn foo() {}
#[test] fn bar() {}

@Oneirical Oneirical force-pushed the testart-from-scratch branch from cd3fe6d to 7ccc842 Compare August 14, 2024 15:14
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 23, 2024
@bors
Copy link
Contributor

bors commented Aug 23, 2024

⌛ Testing commit 318dfb4 with merge 91e4b4a...

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 23, 2024
…eyouxu

Migrate `libtest-thread-limit` `run-make` test to rmake

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Please try, but **only if normal CI is green**:

// try-job: armhf-gnu // <- failed on this
try-job: aarch64-gnu
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-msvc-ext failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] miri test:false 4.575
error: failed to remove file `C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-tools\x86_64-pc-windows-msvc\release\miri.exe`

Caused by:
  Access is denied. (os error 5)
Command has failed. Rerun with -v to see more details.
  local time: Fri, Aug 23, 2024  4:43:48 PM
  network time: Fri, 23 Aug 2024 16:43:49 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@bors
Copy link
Contributor

bors commented Aug 23, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 23, 2024
@jieyouxu
Copy link
Member

@bors retry (msvc ci spurious failure)

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 23, 2024
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Aug 23, 2024
…jieyouxu

Migrate `libtest-thread-limit` `run-make` test to rmake

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Please try, but **only if normal CI is green**:

// try-job: armhf-gnu // <- failed on this
try-job: aarch64-gnu
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 23, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#126985 (Implement `-Z embed-source` (DWARFv5 source code embedding extension))
 - rust-lang#128507 (Migrate `libtest-thread-limit` `run-make` test to rmake)
 - rust-lang#128935 (More work on `zstd` compression)
 - rust-lang#129190 (Add f16 and f128 to tests/ui/consts/const-float-bits-conv.rs)
 - rust-lang#129295 (Build `library/profiler_builtins` from `ci-llvm` if appropriate)
 - rust-lang#129416 (library: Move unstable API of new_uninit to new features)
 - rust-lang#129418 (rustc: Simplify getting sysroot library directory)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Aug 23, 2024

⌛ Testing commit 318dfb4 with merge eef00c8...

@bors
Copy link
Contributor

bors commented Aug 23, 2024

☀️ Test successful - checks-actions
Approved by: jieyouxu
Pushing eef00c8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 23, 2024
@bors bors merged commit eef00c8 into rust-lang:master Aug 23, 2024
7 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 23, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (eef00c8): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (secondary 1.6%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.5% [2.5%, 4.6%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 750.941s -> 751.017s (0.01%)
Artifact size: 338.96 MiB -> 338.95 MiB (-0.00%)


// The fork + exec is required because we cannot first try to limit the number of
// processes/threads to 1 and then try to spawn a new process to run the test. We need to
// setrlimit and run the libtest test program in the same process.
Copy link
Member

Choose a reason for hiding this comment

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

Using cmd.pre_exec(|| setrlimit(...)) would have worked too, right?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it probably would've worked too. I was not aware that existed.

@bjorn3
Copy link
Member

bjorn3 commented Aug 28, 2024

I think the old never properly worked at all. With -Cpanic=abort -Zpanic-abort-tests the test fail (which is to be expected as -Zpanic-abort-tests will always spawn a new process for each test). Before this PR it never failed in cg_clif's CI though. It should probably get a //@ needs-unwind annotation.

@Oneirical
Copy link
Contributor Author

I think the old never properly worked at all.

That is what we found out, it constantly failed because of the test.rs alphabetical order problem, and that failure was silenced.

With -Cpanic=abort -Zpanic-abort-tests the test fail (which is to be expected as -Zpanic-abort-tests will always spawn a new process for each test). Before this PR it never failed in cg_clif's CI though. It should probably get a //@ needs-unwind annotation.

I'm not sure I understand, is it accurate if I rephrase what you said as:

"Adding -Cpanic=abort -Zpanic-abort-tests to the new rmake.rs test causes it to fail, which is normal because -Zpanic-abort-tests will always spawn a new process for each test, causing the process limit to be exceeded."

Before this PR it never failed in cg_clif's CI though.

Are you saying that the new rmake.rs test is failing in Cranelift's CI in its current form, or only if you add the unwind flags?

It should probably get a //@ needs-unwind annotation.

Do you think the test should also be expanded to check that adding -Cpanic=abort -Zpanic-abort-tests causes a failure?

@bjorn3
Copy link
Member

bjorn3 commented Aug 28, 2024

I'm not sure I understand, is it accurate if I rephrase what you said as:

Yes

Are you saying that the new rmake.rs test is failing in Cranelift's CI in its current form, or only if you add the unwind flags?

In it's current form it fails. Adding //@ needs-unwind would cause it to be ignored in cg_clif's CI and anywhere else that runs tests with panic=abort.

@Oneirical
Copy link
Contributor Author

I'm not sure I understand, is it accurate if I rephrase what you said as:

Yes

Are you saying that the new rmake.rs test is failing in Cranelift's CI in its current form, or only if you add the unwind flags?

In it's current form it fails. Adding //@ needs-unwind would cause it to be ignored in cg_clif's CI and anywhere else that runs tests with panic=abort.

Alright, added in #129690.

@jieyouxu
Copy link
Member

jieyouxu commented Aug 28, 2024

I think the old never properly worked at all.

Yes. Unfortunately the test never properly worked ever since it was added due to makefile syntax shenangians. The actual test itself always failed, but the Makefile never fails.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 29, 2024
…ouxu

Add `needs-unwind` compiletest directive to `libtest-thread-limit` and replace some `Path` with `path` in `run-make`

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

This PR does two things:

1. Add this to `libtest-thread-limit` ([Why?](rust-lang#128507 (comment)))
```
//@ needs-unwind
// Reason: this should be ignored in cg_clif (Cranelift) CI and anywhere
// else that uses panic=abort.
```

2. Use `path` instead of `Path` to simplify multiple run-make tests.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 29, 2024
Rollup merge of rust-lang#129690 - Oneirical:run-make-tidbits, r=jieyouxu

Add `needs-unwind` compiletest directive to `libtest-thread-limit` and replace some `Path` with `path` in `run-make`

Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

This PR does two things:

1. Add this to `libtest-thread-limit` ([Why?](rust-lang#128507 (comment)))
```
//@ needs-unwind
// Reason: this should be ignored in cg_clif (Cranelift) CI and anywhere
// else that uses panic=abort.
```

2. Use `path` instead of `Path` to simplify multiple run-make tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

10 participants