Skip to content

Reduce OpenCloseTest iterations and dump threads on hang#4102

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:openclosetest-deadlock-watchdog
Jun 16, 2026
Merged

Reduce OpenCloseTest iterations and dump threads on hang#4102
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:openclosetest-deadlock-watchdog

Conversation

@vogella

@vogella vogella commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

OpenCloseTest occasionally deadlocks on macOS in testOpenClosePerspective and then produces no output until the 1200 second bundle timeout kills the whole JVM, so the run fails with no usable diagnostic. This adds a per method watchdog that dumps all thread stacks and aborts once a method exceeds 200 seconds, so a hang reports a stacktrace instead of being killed silently. A plain JUnit timeout cannot be used here because these tests run on the UI thread. The iteration count is also reduced from 10 to 4 to keep the automated build fast; it can be raised locally for real stress testing.

See #4101.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the OpenCloseTest stress tests to be less costly in CI and to produce actionable diagnostics when a UI-thread deadlock/hang occurs (notably on macOS), by adding a per-test watchdog that emits a full thread dump and then aborts instead of waiting for the bundle-level timeout.

Changes:

  • Reduce stress iteration count from 10 to 4 to keep automated builds faster.
  • Add a per-test watchdog thread that, after 200s, dumps all thread stacks and attempts to abort the JVM if the test remains stuck.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +111 to +115
try {
Thread.sleep(WATCHDOG_GRACE_MS);
} catch (InterruptedException e) {
return; // test recovered after the interrupt and disarmed the watchdog
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. The PR now records the test as failed whenever the per-method deadline is exceeded, even if the thread recovers after the interrupt, so a late run can no longer pass silently.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Test Results

   864 files  ±0     864 suites  ±0   54m 17s ⏱️ + 13m 55s
 8 050 tests ±0   7 807 ✅ +1  243 💤 ±0  0 ❌  - 1 
20 052 runs  +5  19 398 ✅ +6  654 💤 ±0  0 ❌  - 1 

Results for commit 86e1252. ± Comparison against base commit a6b77cc.

♻️ This comment has been updated with latest results.

@vogella

vogella commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Nice, no timeout anymore with this change. The suggestion from from copilot is not wrong, I will update the PR

@vogella vogella force-pushed the openclosetest-deadlock-watchdog branch 2 times, most recently from 3fc54e3 to 86e2f1c Compare June 15, 2026 18:42
@vogella

vogella commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Mobile app still create merge commit, will fix

OpenCloseTest occasionally deadlocks on macOS in testOpenClosePerspective
and then produces no output until the 1200 second bundle timeout kills the
whole JVM, so the run fails with no usable diagnostic.

Add a per method watchdog that dumps all thread stacks and aborts once a
method exceeds 200 seconds, so a hang reports a stacktrace instead of being
killed silently. A plain JUnit timeout cannot be used because these tests
run on the UI thread.

Also reduce the iteration count from 10 to 4 to keep the automated build
fast; it can be raised locally for real stress testing.

eclipse-platform#4101
@vogella vogella force-pushed the openclosetest-deadlock-watchdog branch from 5ef078e to 86e1252 Compare June 15, 2026 20:37
@vogella vogella merged commit 5c4f5a5 into eclipse-platform:master Jun 16, 2026
18 checks passed
@vogella vogella deleted the openclosetest-deadlock-watchdog branch June 16, 2026 06:54
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.

2 participants