JAL-1988 Add a sleep to file save test to give time for file to save
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 26 Jan 2023 11:49:36 +0000 (11:49 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 26 Jan 2023 11:49:36 +0000 (11:49 +0000)
test/jalview/gui/QuitHandlerTest.java

index b1dab96..a8a7f08 100644 (file)
@@ -170,11 +170,15 @@ public class QuitHandlerTest
     viewport.setSavedUpToDate(false);
     Jalview2XML.setStateSavedUpToDate(false);
 
-    // no hanging around needed here
+    // don't want to hang around here
     Cache.setProperty("DEBUG_DELAY_SAVE", "false");
     af.saveAlignment(saveProjectFile, FileFormat.Jalview);
 
-    // this is only a two button dialog [Quit] [Cancel] so use NO_OPTION
+    Thread.sleep(1000); // give time for file to save
+
+    // this is only a two button dialog [Quit] [Cancel] so use NO_OPTION (to
+    // mean [CANCEL] -- file should already be saved so this doesn't happen and
+    // we get a QUIT response)
     JvOptionPane.setMockResponse(JvOptionPane.NO_OPTION);
     QResponse response = QuitHandler.getQuitResponse(true);