JAL-3562 wait until no more events on the queue as well
authorJim Procter <jprocter@issues.jalview.org>
Thu, 26 Mar 2020 13:52:27 +0000 (13:52 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 26 Mar 2020 13:52:27 +0000 (13:52 +0000)
test/jalview/gui/AlignmentPanelTest.java

index 1048d1b..b7d292f 100644 (file)
@@ -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
         {