Skip to content

Conversation

@pvdrz
Copy link
Contributor

@pvdrz pvdrz commented Oct 21, 2025

Currently, the remote-test-client doesn't have a timeout when connecting to the remote-test-server. This means that running tests using it can hang indefinitely which causes issues when running tests on CI, for example.

This PR now sets a default timeout of 5 minutes, meaning that if, for example, TEST_DEVICE_ADDR=<IP:PORT> ./x test --target riscv64gc-unknown-linux-gnu tests/ui is run and the remote-test-server is not reachable by the client, the client will panic after the timeout is reached.

Additionally, the TEST_DEVICE_CONNECT_TIMEOUT env variable can be used to set up the timeout to any value (in seconds).

This PR also wires up a test step for remote-test-client, which didn't previously have tool tests run in CI.

Edit: blocked by #149071

@rustbot rustbot added 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. labels Oct 21, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 21, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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

@pvdrz pvdrz force-pushed the pvdrz/remote-test-client-timeout branch from 1d1f5fd to 799df1c Compare October 22, 2025 14:50
Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

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

LGTM but I no longer have r+ permissions

View changes since this review

@pvdrz pvdrz requested a review from Enselic October 27, 2025 15:49
@rust-log-analyzer

This comment has been minimized.

@Enselic
Copy link
Member

Enselic commented Oct 29, 2025

I'll assign myself to this one for now.

r? Enselic

@rustbot

This comment was marked as resolved.

@Enselic

This comment was marked as resolved.

@rustbot

This comment was marked as resolved.

@Urgau

This comment was marked as resolved.

@rustbot rustbot assigned Enselic and unassigned Mark-Simulacrum Oct 29, 2025
@pvdrz pvdrz requested a review from Enselic October 29, 2025 16:02
Copy link
Member

@Enselic Enselic left a comment

Choose a reason for hiding this comment

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

Found some more things. To avoid confusion for the test later: I would prefer a test that actually invokes the binary rather than having some kind of unit test.

View changes since this review

@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 Oct 30, 2025
@pvdrz pvdrz force-pushed the pvdrz/remote-test-client-timeout branch from b79af79 to 7a6c157 Compare October 30, 2025 18:44
@Enselic
Copy link
Member

Enselic commented Oct 31, 2025

I'm currently happy with the way the code looks. So just a test left as far as I'm concerned.

@pvdrz
Copy link
Contributor Author

pvdrz commented Nov 4, 2025

@Enselic Do you want me to factor out the main function so I can write a unit test for it or do you want me to write a test that actually runs the binary? If you want the latter, I don't know how to do it so I'd need some instructions.

@Enselic
Copy link
Member

Enselic commented Nov 5, 2025

A test that actually runs the binary. I can see that we've had assert_cmd in our Cargo.lock before (added with #125408), so let's see how it feels to use assert_cmd to test the remote-test-client binary. Let's use the same structure as src/tools/jsondoclint/src/validator/tests.rs and put tests.rs under src. I think that helps with build dependency resolution and minimize rebuilds.

Another thing: We need to document the new environment variable in src/doc/rustc-dev-guide/src/tests/running.md.

@rustbot
Copy link
Collaborator

rustbot commented Nov 6, 2025

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.

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Nov 6, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 6, 2025

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol, @tshepang

@rustbot rustbot added the A-rustc-dev-guide Area: rustc-dev-guide label Nov 6, 2025
@pvdrz
Copy link
Contributor Author

pvdrz commented Nov 19, 2025

I have to say that having to split this PR in two after having squashed everything is not great. I'm still going to do it, just wanted to point that out.

@pvdrz pvdrz force-pushed the pvdrz/remote-test-client-timeout branch from 08d3225 to 22236a6 Compare November 19, 2025 00:12
@rustbot

This comment has been minimized.

@Enselic
Copy link
Member

Enselic commented Nov 19, 2025

Thank you for creating a separate PR, and I understand that you don't think the back and forth has been a great experience. Rest assured that everyone is trying their best to navigate the various wills and tradeoffs at play here.

@pvdrz pvdrz force-pushed the pvdrz/remote-test-client-timeout branch from 22236a6 to f56fbc3 Compare November 19, 2025 18:22
@pvdrz pvdrz force-pushed the pvdrz/remote-test-client-timeout branch from f56fbc3 to 2cb03be Compare November 21, 2025 15:58
@rustbot
Copy link
Collaborator

rustbot commented Nov 21, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@pvdrz pvdrz force-pushed the pvdrz/remote-test-client-timeout branch from 2cb03be to 6bd5de7 Compare November 27, 2025 15:41
@pvdrz pvdrz requested a review from Enselic November 27, 2025 15:43
Copy link
Member

@Enselic Enselic left a comment

Choose a reason for hiding this comment

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

With rust-lang/rustc-dev-guide#2657 it is more "official" that adding TEST_DEVICE_CONNECT_TIMEOUT_SECONDS is not that big of a deal. And the code itself looks good to me now, thanks.

@bors r+

(My impression is that you do not expect to be part of r on this PR jieyouxu. Please let me know if I misunderstood.)

I am not going to insist on that you do another rebase, but I'm curious why you split up the implementation and the test as separate commits? That makes a lot of sense to do for bug fixes, since then you could end up wanting to revert the fix but keep the test. But for new features you never want to revert the fix and keep the test, so it makes sense to keep the fix and test in the same commit. And for git blame and git log, people will want to easily find the test that comes along with the fix. Which gets trickier if they are split.

But again, just wanted to mention this. I'm still going to approve this as you can see above.

View changes since this review

@Enselic
Copy link
Member

Enselic commented Nov 28, 2025

TIL that bors does not listen to approval comments.

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 28, 2025

📌 Commit 6bd5de7 has been approved by Enselic

It is now in the queue for this repository.

@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 Nov 28, 2025
bors added a commit that referenced this pull request Nov 28, 2025
Rollup of 6 pull requests

Successful merges:

 - #147952 (Add a timeout to the `remote-test-client` connection)
 - #149321 (Fix ICE when include_str! reads binary files)
 - #149398 (add regression test for issue #143987)
 - #149411 (Tidying up UI tests [5/N])
 - #149413 (add test for issue 143821)
 - #149415 (Remove test-float-parse from workspace list in tidy)

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

pvdrz commented Nov 28, 2025

but I'm curious why you split up the implementation and the test as separate commits? That makes a lot of sense to do for bug fixes, since then you could end up wanting to revert the fix but keep the test. But for new features you never want to revert the fix and keep the test, so it makes sense to keep the fix and test in the same commit.

Yeah but if someone reverts the feature, they need to remind themselves that they changed the interface of the tool and that a test is broken because we expected that feature to exist. So having to also revert the test is a little safety belt so they don't break other people's workflow by accident.

bors added a commit that referenced this pull request Nov 28, 2025
Rollup of 6 pull requests

Successful merges:

 - #147952 (Add a timeout to the `remote-test-client` connection)
 - #149321 (Fix ICE when include_str! reads binary files)
 - #149398 (add regression test for issue #143987)
 - #149411 (Tidying up UI tests [5/N])
 - #149413 (add test for issue 143821)
 - #149415 (Remove test-float-parse from workspace list in tidy)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d7a36c1 into rust-lang:main Nov 28, 2025
11 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 28, 2025
rust-timer added a commit that referenced this pull request Nov 28, 2025
Rollup merge of #147952 - ferrocene:pvdrz/remote-test-client-timeout, r=Enselic

Add a timeout to the `remote-test-client` connection

Currently, the `remote-test-client` doesn't have a timeout when connecting to the `remote-test-server`. This means that running tests using it can hang indefinitely which causes issues when running tests on CI, for example.

This PR now sets a default timeout of 5 minutes, meaning that if, for example, `TEST_DEVICE_ADDR=<IP:PORT> ./x test --target riscv64gc-unknown-linux-gnu tests/ui` is run and the `remote-test-server` is not reachable by the client, the client will panic after the timeout is reached.

Additionally, the `TEST_DEVICE_CONNECT_TIMEOUT` env variable can be used to set up the timeout to any value (in seconds).

This PR also wires up a test step for `remote-test-client`, which didn't previously have tool tests run in CI.

Edit: ~~blocked by #149071~~
@tshepang tshepang deleted the pvdrz/remote-test-client-timeout branch November 28, 2025 22:54
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Nov 29, 2025
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#147952 (Add a timeout to the `remote-test-client` connection)
 - rust-lang/rust#149321 (Fix ICE when include_str! reads binary files)
 - rust-lang/rust#149398 (add regression test for issue rust-lang/rust#143987)
 - rust-lang/rust#149411 (Tidying up UI tests [5/N])
 - rust-lang/rust#149413 (add test for issue 143821)
 - rust-lang/rust#149415 (Remove test-float-parse from workspace list in tidy)

r? `@ghost`
`@rustbot` modify labels: rollup
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Dec 1, 2025
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#147952 (Add a timeout to the `remote-test-client` connection)
 - rust-lang/rust#149321 (Fix ICE when include_str! reads binary files)
 - rust-lang/rust#149398 (add regression test for issue rust-lang/rust#143987)
 - rust-lang/rust#149411 (Tidying up UI tests [5/N])
 - rust-lang/rust#149413 (add test for issue 143821)
 - rust-lang/rust#149415 (Remove test-float-parse from workspace list in tidy)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc 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

None yet

Development

Successfully merging this pull request may close these issues.

9 participants