8023814: Test java/awt/im/memoryleak/InputContextMemoryLeakTest.java fails

Reviewed-by: psadhukhan
This commit is contained in:
Alexander Zvegintsev 2022-04-21 13:03:30 +00:00
parent 9a905ccc5e
commit 42baaa3bb8
2 changed files with 7 additions and 4 deletions

View File

@ -483,7 +483,6 @@ java/awt/Toolkit/DesktopProperties/rfe4758438.java 8193547 linux-all
java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java 6847163
java/awt/xembed/server/RunTestXEmbed.java 7034201 linux-all
java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java 8164473 linux-all
java/awt/im/memoryleak/InputContextMemoryLeakTest.java 8023814 linux-all
java/awt/Frame/DisposeParentGC/DisposeParentGC.java 8079786 macosx-all
java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java 7099223,8274106 macosx-aarch64,linux-all,windows-all

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,6 @@
import java.awt.FlowLayout;
import java.awt.Robot;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
@ -88,7 +87,12 @@ public class InputContextMemoryLeakTest {
//After the next caret blink it automatically TextField references
Thread.sleep(text.get().getCaret().getBlinkRate() * 2);
Util.waitForIdle(null);
assertGC();
try {
assertGC();
} finally {
SwingUtilities.invokeAndWait(() -> frame.dispose());
}
}
public static void assertGC() throws Throwable {