Skip to content

Conversation

@jonahgraham
Copy link
Contributor

At the moment the code silently fails on calling timerExec if there are no handles left or it fails for other reasons.

Relates to #2806 where we can see that we are running out of handles, but the timerExec does not report a failure.

At the moment the code silently fails on calling timerExec if there
are no handles left or it fails for other reasons.

Relates to eclipse-platform#2806
where we can see that we are running out of handles, but the timerExec
does not report a failure.
@jonahgraham
Copy link
Contributor Author

This is a draft for now because it needs consideration for other platforms and whether after 25 years there is a reason that this case was allowed to fail silently on Windows.

On macOS there is a pointless null check in the same place because an NPE would have already been raised. On GTK I need to investigate more because the functions are not documented as being able to fail.

macOS:

NSTimer timer = NSTimer.scheduledTimerWithTimeInterval(milliseconds / 1000.0, timerDelegate, OS.sel_timerProc_, userInfo, false);
NSRunLoop runLoop = NSRunLoop.currentRunLoop();
runLoop.addTimer(timer, OS.NSModalPanelRunLoopMode);
runLoop.addTimer(timer, OS.NSEventTrackingRunLoopMode);
timer.retain();
if (timer != null) {
nsTimers [index] = timer;
timerList [index] = runnable;
}
}

GTK:

if (GTK.GTK4) {
timerId = OS.g_timeout_add (milliseconds, timerProc, index);
} else {
timerId = GDK.gdk_threads_add_timeout (milliseconds, timerProc, index);
}
if (timerId != 0) {
timerIds [index] = timerId;
timerList [index] = runnable;
}
}

@github-actions
Copy link
Contributor

Test Results

  115 files   -  3    115 suites   - 3   10m 36s ⏱️ - 7m 10s
4 616 tests  - 37  4 598 ✅  - 38  18 💤 +1  0 ❌ ±0 
  320 runs   - 18    317 ✅  - 17   3 💤  - 1  0 ❌ ±0 

Results for commit 37b2026. ± Comparison against base commit 28bb9b4.

This pull request removes 37 tests.
AllGTKTests Test_GtkConverter ‑ test_HeuristicASCII_dollarSign
AllGTKTests Test_GtkConverter ‑ test_HeuristicASCII_emptyString
AllGTKTests Test_GtkConverter ‑ test_HeuristicASCII_letterA
AllGTKTests Test_GtkConverter ‑ test_HeuristicASCII_letters
AllGTKTests Test_GtkConverter ‑ test_HeuristicUTF16LE_null
AllGTKTests Test_GtkConverter ‑ test_HeuristicUTF16_AsciiLetters
AllGTKTests Test_GtkConverter ‑ test_HeuristicUTF16_Asciiletter
AllGTKTests Test_GtkConverter ‑ test_HeuristicUTF16_LotsOfLetters
AllGTKTests Test_GtkConverter ‑ test_HeuristicUTF16_letter
AllGTKTests Test_GtkConverter ‑ test_HeuristicUTF16_letters
…
This pull request skips 3 tests.
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_browser_Browser ‑ test_setUrl_remote_with_post
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_browser_Browser_IE ‑ test_setUrl_remote_with_post
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_widgets_Shell ‑ test_activateEventSend

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant