From 8ffa4b8a6aa12e528bf19a62df99d3fa4acbcefb Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 26 Mar 2020 13:52:27 +0000 Subject: [PATCH] JAL-3562 wait until no more events on the queue as well --- test/jalview/gui/AlignmentPanelTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/jalview/gui/AlignmentPanelTest.java b/test/jalview/gui/AlignmentPanelTest.java index 1048d1b..b7d292f 100644 --- a/test/jalview/gui/AlignmentPanelTest.java +++ b/test/jalview/gui/AlignmentPanelTest.java @@ -35,6 +35,7 @@ import jalview.viewmodel.ViewportRanges; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; +import java.awt.Toolkit; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -59,7 +60,9 @@ public class AlignmentPanelTest */ synchronized (this) { - while (af.getViewport().isCalcInProgress()) + while (af.getViewport().isCalcInProgress() + || Toolkit.getDefaultToolkit().getSystemEventQueue() + .peekEvent() != null) { try { -- 1.7.10.2