Skip to content

Test tree should scroll to the failed test. #2835

Closed

Description

@HerrNiklasRaab

When you execute a test, the test tree always scrolls to the currently executed test, which is great. But when the test turns from green to red, the test jumps to the top, but the test tree doesn't scroll to the top. Only after executing the test again, it scrolls to the top.

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Sep 30, 2020
  2. added
    in testingRelates to test execution of Dart/Flutter tests for end users
    on Sep 30, 2020
  3. added this to the v3.16.0 milestone on Sep 30, 2020
  4. DanTup commented on Oct 23, 2020

    @DanTup
    Member

    This might be that we call reveal() on the node before the tree is properly updated (re-sorted for statuses). Delaying the reveal until after the data is updated (or at least with a small delay/setImmediate) might fix it.

  5. DanTup commented on Oct 23, 2020

    @DanTup
    Member

    @HerrNiklasRaab actually, I'm struggling to repro this. I had a very long list of green tests in the second suite, an I caused on to fail. This moves the suite to the top of the list, but it also scrolled the tree up so that the newly-failed test (though not the suite - as that was still scrolled off the top) was still visible.

    Can you still repro this? Can you capture a recording, or give more detailed that might help me reproduce it? Thanks!

  6. HerrNiklasRaab commented on Oct 23, 2020

    @HerrNiklasRaab
    Author
  7. DanTup commented on Oct 26, 2020

    @DanTup
    Member

    Thanks! I think I can repro. Doesn't seem to happen the test is very fast, but does if I add a delay.

  8. added and removed
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Oct 26, 2020
  9. DanTup commented on Oct 26, 2020

    @DanTup
    Member

    This seems to be a race because the tree update is async (we tell VS Code it's changed, then it asks us for the new data on its own schedule) and we were revealing the tree node immediately. I can't find a great way to handle this, but adding a 100ms delay before trying to reveal the node seems to be reliable in my testing. If it turns out to be intermittent, I'll see if I can come up with something better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in testingRelates to test execution of Dart/Flutter tests for end usersis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions