Skip to content

Conversation

@aronwolf90
Copy link
Contributor

@aronwolf90 aronwolf90 commented Sep 20, 2025

Motivation / Background

Right now, if one presses CONTROL+C during the parallel test run, one gets a very long backtrace that is very annoying.

Additional information

The same problem was solved 11 years ago for the non parallel tests here:

The reason why the 11 years old fix does not work for the parallel test is, that the rescue happens before the shutdown method gets executed. The shutdown method is where things get executed. In my opinion, this is wrong, but my guess is, that it was done so, because doing it otherwise would probably require changes in the Minitest gem itself.

NOTE: this is my first PR on the rails gem, so I apologize if I made something wrong. Also, there is a big probability that there is a better solution or that I miss some edge case that I am missing because of lack of knowledge.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.
    • Not sure if this should go into the changelog.

@aronwolf90 aronwolf90 force-pushed the remove-annoying-backtrace-on-parallel-test-abortion branch 2 times, most recently from d6e239a to 5af11e6 Compare September 21, 2025 11:15
@aronwolf90
Copy link
Contributor Author

@joshuay03 I sow that you worked on something similary. Maybe you can review the PR?

NOTE:I totaly understand if you have no time for it. At the end removing the backtrace is just a cosmetic thing :) and there are probably a lot more important things to fix than this.

@joshuay03
Copy link
Contributor

@joshuay03 I sow that you worked on something similary. Maybe you can review the PR?

NOTE:I totaly understand if you have no time for it. At the end removing the backtrace is just a cosmetic thing :) and there are probably a lot more important things to fix than this.

Yes, I can have a look soonish. Please note though that maintainers prefer not to be tagged directly, and you should follow the process documented in the contributing guides:

@rafaelfranca rafaelfranca force-pushed the remove-annoying-backtrace-on-parallel-test-abortion branch from 5af11e6 to 9ed47d7 Compare October 15, 2025 23:36
Right now if one presses CONTROL+C during the
parallel test run, one get a very long
backtrace that is very annoying.

The same problem was solved 11 years ago
for the non parallel tests here:

* minitest/minitest@b6ec36d
* minitest/minitest#503

The reason why the 11 years old fix does not
work for the parallel test is, that the rescue
happens before the shutdown method gets executed.
The shutdown method is where things gets executed.
In my opinion, this is wrong, but my guess is, that
it was done so, because doing it otherwise would
probably require changes in the Minitest gem itself.

NOTE: this is my first PR on the rails gem, so I apologize
if I made something wrong. Also, there is a big probability
that there is a better solution or that I miss some edge
case that I am missing because of lack of knowledge.
@rafaelfranca rafaelfranca force-pushed the remove-annoying-backtrace-on-parallel-test-abortion branch from 9ed47d7 to 96c6112 Compare October 15, 2025 23:51
@rafaelfranca rafaelfranca merged commit 861a85e into rails:main Oct 16, 2025
3 checks passed
@joshuay03
Copy link
Contributor

Thank you!! @rafaelfranca

@aronwolf90
Copy link
Contributor Author

Thanks! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants