You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/ReleaseNotes4.13.2.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,3 +11,20 @@ people reported problems that were caused by explicitly destroying the `ThreadGr
11
11
12
12
In this change, the code was updated to call `ThreadGroup.setDaemon(true)` instead of destroying the
13
13
ThreadGroup.
14
+
15
+
### [Pull request $1691:](https://github.com/junit-team/junit/pull/1691) Only create ThreadGroups if FailOnTimeout.lookForStuckThread is true.
16
+
17
+
In JUnit 4.12 ([pull request #742](https://github.com/junit-team/junit4/pull/742)) the `Timeout`
18
+
Rule was updated to optionally display the stacktrace of the thread that appears to be stuck
19
+
(enabled on an opt-in basis by passing `true` to `Timeout.Builder.lookForStuckThread(boolean)`).
20
+
When that change was made, time-limited tests were changed to start the new thread in a new
21
+
`ThreadGroup`, even if the test did not call `lookForStuckThread()`. This subtle change in
22
+
behavior resulted in visible behavior changes to some tests (for example, tests of code that uses
23
+
`java.beans.ThreadGroupContext`).
24
+
25
+
In this change, the code is updated to only create a new `ThreadGroup` if the caller calls
26
+
`Timeout.Builder.lookForStuckThread(true)`. Tests with timeouts that do not make this call will
27
+
behave as they did in JUnit 4.11 (and more similar to tests that do not have a timeout). This
28
+
unfortunately could result in visible changes of tests written or updated since the 4.12
29
+
release. If this change adversely affects your tests, you can create the `Timeout` rule via the
30
+
builder and call `Timeout.Builder.lookForStuckThread(true)`.
0 commit comments