Skip to content

Commit

Permalink
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);
#if OS(WINDOWS) && PLATFORM(JAVA)
// 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
// http://omeg.pl/blog/2011/11/on-winapi-timers-and-their-resolution, 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;
#endif
m_runLoop->dispatchAfter(delay, [protect, function = WTFMove(function)] {
#if PLATFORM(JAVA)
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 {

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

1 comment on commit e481f8c

@openjdk-notifier
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.