Skip to content

remote-test-client: Exit code 128 + <signal-number> instead of 3 #143448

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Enselic
Copy link
Member

@Enselic Enselic commented Jul 4, 2025

If the remote process is terminated by a signal, make remote-test-client exit with the code 128 + <signal-number> instead of always 3. This follows common practice among tools such as bash 1:

When a command terminates on a fatal signal whose number is N, Bash uses the
value 128+N as the exit status.

It also allows us to differentiate between run-pass and run-crash ui tests without special case code in compiletest for that when remote-test-client is used. See #143002 and in particular #143002 (comment).

Exiting with code 3 has been done from the start (see #39400) and seems arbitrary rather than a deliberate design decision, so changing it does not seem like an extraordinarily big deal.

Regression testing

Note that #143002 will act as a regression test once it is rebased on this PR.

Why a separate PR

I think it is comforting to know that CI does not break with just this change. But if my reviewer prefers, we can move this commit to be part of #143002 instead.

Footnotes

  1. https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html

If the remote process is terminated by a signal, make `remote-test-client` exit
with the code `128 + <signal-number>` instead of always `3`. This follows common
practice among tools such as bash [^1]:

> When a command terminates on a fatal signal whose number is N, Bash uses the
> value 128+N as the exit status.

It also allows us to differentiate between `run-pass` and `run-crash` ui tests
without special case code in compiletest for that when `remote-test-client` is
used.

[^1]: https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html
@rustbot
Copy link
Collaborator

rustbot commented Jul 4, 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

@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 Jul 4, 2025
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 13, 2025

📌 Commit 148a220 has been approved by Mark-Simulacrum

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 Jul 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants