Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
pinzart90 committed Apr 25, 2024
1 parent f392570 commit 85bda77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/DynamoCoreWpfTests/Utility/DispatcherUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public static class DispatcherUtil
public static void DoEvents()
{
var frame = new DispatcherFrame();

// Invoke with the lowest priority possible so that other tasks (with higher priority) can get a chance to finish.
Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.SystemIdle,
new DispatcherOperationCallback(ExitFrame), frame);
Dispatcher.PushFrame(frame);
Expand All @@ -29,7 +31,7 @@ public static void DoEvents()
/// <param name="check">When check returns true, the even loop is stopped.</param>
public static void DoEventsLoop(Func<bool> check = null)
{
const int max_count = 20;
const int max_count = 200;

int count = 0;
while (true)
Expand All @@ -44,7 +46,7 @@ public static void DoEventsLoop(Func<bool> check = null)
}

DispatcherUtil.DoEvents();
Thread.Sleep(1000);
Thread.Sleep(100);
count++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class NodeManipulatorExtensionTests : DynamoTestUIBase
[SetUp]
public virtual void Start()
{
// Forcing the dispatcher to execute all of its tasks within these tests causes crashes in Helix.
// For now just skip it.
SkipDispatcherFlush = true;
base.Start();
}
Expand Down

0 comments on commit 85bda77

Please sign in to comment.