Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't execute the setup method for NodeManipulatorExtensionTests tests twice #15768

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions test/DynamoCoreWpfTests/DynamoTestUIBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -132,10 +130,10 @@ protected virtual DynamoModel.IStartConfiguration CreateStartConfiguration(IPath
[TearDown]
public void Exit()
{

Dispatcher.CurrentDispatcher.Hooks.OperationPosted -= Hooks_OperationPosted;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we remove the handler only after the DoEventsLoop ?
I wonder if operations can still post other operations..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting...

if (!SkipDispatcherFlush)
{
Dispatcher.CurrentDispatcher.Hooks.OperationPosted -= Hooks_OperationPosted;

DispatcherUtil.DoEventsLoop(() => DispatcherOpsCounter == 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected override IEnumerable<IGizmo> GetGizmos(bool createOrUpdate)
public class NodeManipulatorExtensionTests : DynamoTestUIBase
{
[SetUp]
public virtual void Start()
public override void Start()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!. DId you try to turn on the dispatrcher ops waiting after this change ?

Copy link
Member Author

@mjkkirschner mjkkirschner Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not, will give it a shot, were you able to repro the helix crash locally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on second thought, there's no reason for this method to exist if we're flushing the dispatcher.

Also, I think theres something weird with the way we increment the dispatcher ops when this flag is true...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did manage to reproduce the crash locally

{
// Forcing the dispatcher to execute all of its tasks within these tests causes crashes in Helix.
// For now just skip it.
Expand Down
Loading