Skip to content

[2.x] fix: Prevent sbt test from hanging when forked process crashes#8536

Merged
eed3si9n merged 1 commit intosbt:developfrom
MkDev11:fix/fork-test-hang-on-error-7429
Jan 15, 2026
Merged

[2.x] fix: Prevent sbt test from hanging when forked process crashes#8536
eed3si9n merged 1 commit intosbt:developfrom
MkDev11:fix/fork-test-hang-on-error-7429

Conversation

@MkDev11
Copy link
Copy Markdown
Contributor

@MkDev11 MkDev11 commented Jan 15, 2026

When a forked test process crashes (e.g., due to UnsupportedClassVersionError), sbt would hang forever waiting for test results. This happened because notifyExit only completed the promise with success, regardless of the exit code.

This fix checks the exit code and fails the promise if the process exited with a non-zero code, allowing sbt to properly report the failure and exit.

Fixes #7429


Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=94194147

When a forked test process crashes (e.g., due to UnsupportedClassVersionError),
sbt would hang forever waiting for test results. This happened because
notifyExit only completed the promise with success, regardless of the
exit code.

This fix checks the exit code and fails the promise if the process
exited with a non-zero code, allowing sbt to properly report the failure
and exit.

Fixes sbt#7429
@MkDev11
Copy link
Copy Markdown
Contributor Author

MkDev11 commented Jan 15, 2026

@eed3si9n please have a look at the PR and let me know the result

@eed3si9n eed3si9n changed the title fix: Prevent sbt test from hanging when forked process crashes [2.x] fix: Prevent sbt test from hanging when forked process crashes Jan 15, 2026
Copy link
Copy Markdown
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

Thanks!

@eed3si9n eed3si9n merged commit fb53925 into sbt:develop Jan 15, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sbt test hangs on UnsupportedClassVersionError

2 participants