Skip to content


Browse files Browse the repository at this point in the history
8260163: IrresponsiveScriptTest.testInfiniteLoopInScript unit test fa…
…ils on Windows

Reviewed-by: kcr
  • Loading branch information
arun-joseph committed Feb 2, 2021
1 parent 217a8cb commit e481f8c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 199 deletions.
Expand Up @@ -72,6 +72,19 @@ void WorkQueue::dispatch(Function<void()>&& function)
void WorkQueue::dispatchAfter(Seconds delay, Function<void()>&& function)
RefPtr<WorkQueue> protect(this);
// From empirical testing, we've seen CreateTimerQueueTimer() sometimes fire up to 5+ ms early.
// This causes havoc for clients of this code that expect to not be called back until the
// specified duration has expired. Other folks online have also observed some slop in the
// firing times of CreateTimerQuqueTimer(). From the data posted at
//, it appears that the slop
// can be up to about 10 ms. To ensure that we don't fire the timer early, we'll tack on a
// slop adjustment to the duration, and we'll use double the worst amount of slop observed
// so far.
const Seconds slopAdjustment { 20_ms };
if (delay)
delay += slopAdjustment;
m_runLoop->dispatchAfter(delay, [protect, function = WTFMove(function)] {
AttachThreadAsDaemonToJavaEnv autoAttach;
Expand Down
197 changes: 0 additions & 197 deletions modules/javafx.web/src/main/native/Source/WTF/wtf/win/WorkQueueWin.cpp

This file was deleted.

Expand Up @@ -32,12 +32,10 @@
import javafx.scene.web.WebEvent;
import netscape.javascript.JSException;
import org.junit.Assume;
import org.junit.Ignore;
import org.junit.Test;

public class IrresponsiveScriptTest extends TestBase {

@Test public void testInfiniteLoopInScript() {
try {
// This infinite loop should get interrupted by Webkit in about 10s.
Expand Down

1 comment on commit e481f8c

Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.