From 913e2a6dc2c355d47c5be3e6ad0e7b3abea7e34d Mon Sep 17 00:00:00 2001 From: "mjk.kirschner" <508936+mjkkirschner@users.noreply.github.com> Date: Tue, 21 Jan 2025 14:44:31 -0500 Subject: [PATCH 1/2] dont run setup twice --- .../ViewExtensions/NodeManipulatorExtensionTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/DynamoCoreWpfTests/ViewExtensions/NodeManipulatorExtensionTests.cs b/test/DynamoCoreWpfTests/ViewExtensions/NodeManipulatorExtensionTests.cs index 22a1499250e..aa2b7b0e800 100644 --- a/test/DynamoCoreWpfTests/ViewExtensions/NodeManipulatorExtensionTests.cs +++ b/test/DynamoCoreWpfTests/ViewExtensions/NodeManipulatorExtensionTests.cs @@ -28,7 +28,7 @@ protected override IEnumerable GetGizmos(bool createOrUpdate) public class NodeManipulatorExtensionTests : DynamoTestUIBase { [SetUp] - public virtual void Start() + public override void Start() { // Forcing the dispatcher to execute all of its tasks within these tests causes crashes in Helix. // For now just skip it. From 23b487d8228b78586d0134ce40eabd4723719603 Mon Sep 17 00:00:00 2001 From: "mjk.kirschner" <508936+mjkkirschner@users.noreply.github.com> Date: Tue, 21 Jan 2025 15:07:56 -0500 Subject: [PATCH 2/2] still increment and decrement dispatcher ops counter even if we skip flushing the queue --- test/DynamoCoreWpfTests/DynamoTestUIBase.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/DynamoCoreWpfTests/DynamoTestUIBase.cs b/test/DynamoCoreWpfTests/DynamoTestUIBase.cs index 9175df423ee..65777bb0ce3 100644 --- a/test/DynamoCoreWpfTests/DynamoTestUIBase.cs +++ b/test/DynamoCoreWpfTests/DynamoTestUIBase.cs @@ -90,10 +90,8 @@ public virtual void Start() SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext()); - if (!SkipDispatcherFlush) - { - Dispatcher.CurrentDispatcher.Hooks.OperationPosted += Hooks_OperationPosted; - } + Dispatcher.CurrentDispatcher.Hooks.OperationPosted += Hooks_OperationPosted; + } protected static void RaiseLoadedEvent(FrameworkElement element) @@ -132,10 +130,10 @@ protected virtual DynamoModel.IStartConfiguration CreateStartConfiguration(IPath [TearDown] public void Exit() { + + Dispatcher.CurrentDispatcher.Hooks.OperationPosted -= Hooks_OperationPosted; if (!SkipDispatcherFlush) { - Dispatcher.CurrentDispatcher.Hooks.OperationPosted -= Hooks_OperationPosted; - DispatcherUtil.DoEventsLoop(() => DispatcherOpsCounter == 0); }