dseinternational / open-dotnet

Libraries and tools supporting DSE Open systems and technologies.
MIT License
0 stars 0 forks source link

Intermittent DomainEventDispatcherTests test failure #192

Open rabuckley opened 1 week ago

rabuckley commented 1 week ago
Assert.True() Failure
  Expected: True
  Actual:   False
    at DSE.Open.DomainModel.Tests.Events.DomainEventDispatcherTests.Dispatcher_PublishEvents() in /home/runner/work/open-dotnet/open-dotnet/test/DSE.Open.DomainModel.Tests/Events/DomainEventDispatcherTests.cs:62

https://github.com/dseinternational/open-dotnet/blob/c2b6c7b773c210ddf99725b12d11505719ff4fcf/test/DSE.Open.DomainModel.Tests/Events/DomainEventDispatcherTests.cs#L37-L62

Failing assert is

Assert.True(state.ContainsKey(bev.Instance.ToString())); 
frankbuckley commented 1 week ago

Should we pass Xunit text context cancellation token here (L57)?

rabuckley commented 6 days ago

Perhaps, but that won't fix it. Looks like a race between the background event being added to state and us reading state to see if the event is in there.