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

Execute tests - TreeView is flickering #1165

Open
rowo360 opened this issue Dec 8, 2024 · 1 comment · May be fixed by #1167
Open

Execute tests - TreeView is flickering #1165

rowo360 opened this issue Dec 8, 2024 · 1 comment · May be fixed by #1167
Assignees
Labels
Bug Something isn't working as expected.

Comments

@rowo360
Copy link
Contributor

rowo360 commented Dec 8, 2024

Describe the bug
I notice some annoying flickering of the test tree when executing a large amount of tests.
In my case the assembly contains 5000 unit tests which are running pretty fast.
First analysis shows up that this flickering issue is a side effect of the implementation for issue #1137 - which wants to show the test duration in test tree nodes.

To Reproduce
Steps to reproduce the behavior:

  1. Open test assembly which contains several fast running tests (for example the attached one)
  2. Run 'All tests'
    => Observe test tree flicking

Sample test project.zip

Expected behavior
I expect that there's no flickering.

Environment (please complete the following information):

  • TestCentric Version: Current developer build, but I assume that this issue exists also in previous beta versions
  • OS: Windows 11
  • Target Runtime for your test assembly: NET Framework 4.8
@rowo360 rowo360 added the Bug Something isn't working as expected. label Dec 8, 2024
@rowo360 rowo360 self-assigned this Dec 8, 2024
@rowo360
Copy link
Contributor Author

rowo360 commented Dec 8, 2024

Analysis:
The idea for issue #1137 (Show test duration in tree nodes) was to display the test duration as soon as a test is finished - that is identically to the Tree Node image (Passed, Failed...). However in this case we are setting the TreeNode name.
In the sample project there are 5000 tests and thus 5000 TestFinished events, which means that 5000x a TreeNode name is updated. I observed and learned now, that setting a tree node name, will invoke a refresh of the entire tree.
That means that the tree is gettings refreshed over and over again, resulting in that flickering.

Proposed solution:
I suggest that we take a step back: flickering is annoying and must be avoided in the first place.
Therefore I suggest that we update the tree node names for the 'Show test duration' feature once at end of the test run instead. Of course that's not that beneficial as before, but for now it's an easy solution. Moreover we can add some BeginUpdate()/EndUpdate() statements in this case.

Another idea was to update the test duration in tree nodes not as soon as a test method finished, but only as soon as a test fixture finshed (updating all tree nodes of that fixture). I believe that would work for my sample project, but I also believe that the flickering effect will return if using a slightly different project (for example: many fixtures with few test methods)
So, I dropped this idea.

@rowo360 rowo360 linked a pull request Dec 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant