Terminal.Gui: Multi_Thread_Toplevels unit tests fails if run standalone or in different order

I just discovered that Multi_Thread_Toplevels in UnitTests/ViewTests.cs fails if it is run as a standalone test or if the order of what tests run before it change.

image

I discovered this when I was re-factoring how the unit tests are organized.

This test has some dependency from prior running tests that allow it to succeed. Or there is actually a bug in MainLoop that is HIDDEN because of another unit test.

If all of the tests in the ViewTests.cs are run, it does not fail. So the dependency is likely in there.

@BDisp I think I will need you help debugging this!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 17

Most upvoted comments

Fixed

We should not feel satisfied with this test until we can explain it!

-cek Via mobile; expect brevity, typos, and dangerous driving.


From: BDisp @.> Sent: Wednesday, April 21, 2021 11:11:34 AM To: migueldeicaza/gui.cs @.> Cc: Charlie Kindel @.) @.>; Author @.***> Subject: Re: [migueldeicaza/gui.cs] Multi_Thread_Toplevels unit tests fails if run standalone or in different order (#1238)

Something in your configuration changes the MainLoop timer. Before when count was less than 15 and count1 greater than 13, or equal to 14 it pass. Now when count is equal to 14 the count1 is equal to 13. I haven’t an explanation for this, sorry.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/migueldeicaza/gui.cs/issues/1238#issuecomment-824258269, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAEO6CTCBIRMHNDUTR5TKY3TJ4INNANCNFSM43KTFHDA.

I’m going to comment it out in my code coverage PR. When you figure it out and fix, please uncomment that. Thanks!

I’ve found that simply changing the name of the method (e.g. to zMulti_Thread_Toplevels) can change whether it works or not when run with the other tests!