Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 23f5029

Browse files
authored
Merge pull request #9064 from mono/leak-test-flakey
Attempt to fix flakey leak test that happens due to not waiting for t…
2 parents 1b5b3ea + 5bf9e66 commit 23f5029

File tree

1 file changed

+14
-2
lines changed
  • main/tests/UserInterfaceTests

1 file changed

+14
-2
lines changed

main/tests/UserInterfaceTests/Ide.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,20 @@ public static void OpenFile (FilePath file)
5252

5353
public static void CloseAll (bool exit = true)
5454
{
55-
Session.ExecuteCommand (FileCommands.SaveAll);
56-
Session.ExecuteCommand (FileCommands.CloseWorkspace);
55+
var isDirty = (bool)Session.GetGlobalValue ("MonoDevelop.Ide.IdeApp.Workbench.DocumentsDirty");
56+
if (isDirty) {
57+
Session.RunAndWaitForTimer (() => {
58+
Session.ExecuteCommand (FileCommands.SaveAll);
59+
}, "Ide.Shell.SaveAll");
60+
}
61+
62+
var workspaceOpen = (bool)Session.GetGlobalValue ("MonoDevelop.Ide.IdeApp.Workspace.IsOpen");
63+
if (workspaceOpen) {
64+
Session.RunAndWaitForTimer (() => {
65+
Session.ExecuteCommand (FileCommands.CloseWorkspace);
66+
}, "Ide.Shell.CloseWorkspace");
67+
}
68+
5769
if (exit)
5870
Session.ExitApp ();
5971
}

0 commit comments

Comments
 (0)