-
Notifications
You must be signed in to change notification settings - Fork 321
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
Gutter test icons sometimes show on wrong line when helper functions call setup/teardown #4163
Comments
I was able to reproduce something similar by cutting the entire file to clipboard and then pasting it back. Sometimes it updates fine, and sometimes it does not. When it does not, closing the file and re-opening it seems to fix it. Changing the name of a test also seems to fix it. |
Maye something to do with debouncing? If I cut the entire doc and wait for the test runner to clear, then paste, things come back correctly. If I paste before it updates, then it gets into the broken state. |
I think this might be a VS Code issue. I've filed microsoft/vscode#161320 with some steps to repro what seems like this issue using their sample project. I believe VS Code's test runner is doing an internal diff and skipping some work when the tests have not really changed. However, because of our debouncing, it's easy to make a set of changes where the test ends up back on the same line as it was originally (and thus doesn't get updated), but VS Code's editor had moved the gutter icons to compensate for some change in-between. |
A fix has been made in VS Code: microsoft/vscode#161320. I'm not certain that it's the same issue, but I think there's a good chance. VS Code usually releases in the first week of each month, so it's probably ~2weeks away. Please let me know if you see this at all again after VS Code updates and we can do some more digging. |
Hi @DanTup Thanks for your effort in looking into this. I haven't faced the issue again so far -- probably because I turned " I'll circle back if it appears again. |
I had a quick scan through the code again and I suspect the CodeLens setting doesn't actually impact this now. Our test discovery works even without the CodeLens (which is show we populate the test runner even when codeLens is not enabled). I'll keep this open a little until the VS Code release goes out and if it doesn't come up again after that, close it (or let the stale bot). Thanks! |
This issue has been marked stale because it is tagged awaiting-info for 20 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days. |
Hi @DanTup I'm not sure if this is the same issue (in line 12, I believe the checkmark should be next to main) To reproduce:
Sorry wrote this in a rush before I forget about it...
|
I don't know if it's the same issue either, but since one issue was fixed by VS Code which may or may not have been the original issue, we can use this issue for the above (since I can repro and it should be easier to track down), and if any other issues continues after this is fixed, we can file a new issue. I can repro your issue, but small refactors to try and get it into a small single file seem to stop it from happening. I'll do some debugging and see what's going on. Sorry for the delay! |
So, I expect this probably is the original issue you saw. What seems to be happening is that then The JSON from
|
(sorry for the spam, I tend to keep notes on issues in case I get distracted and have to come back to them 😄) It seems we use It's a little odd/confusing having them show up this way, but it's how So I think if we fix the off-by-one error, maybe that would be fine. However - given that, I'm now less convinced that it's the same issue as the screenshot right at the top 😄 I'm outta time for today, but will do some more digging into this tomorrow.. I'm hoping to do an extension release tomorrow, but if this is an easy fix I'd like to get it in the release. |
I've pushed a fix for the off-by-one error: It's a little odd (confusing?) that this appears here, but the general design here is that if your test calls functions in other files (which may call I think it would probably be better if VS Code let us mark setup/teardown as "not runnable", so we can still show them in the tree (to indicate where the failure was), but without them behaving like tests that can be run. Right now if you try to run one of these, it will fail. I'll file a VS Code issue and see what the response is. If they don't want to do this, maybe we can reconsider showing them in the tree in this way. If you see any additional issues with bad alignment like this, let's file new issues to investigate them specifically. Thanks! |
Looks like we might actually be able to already restrict this, so I've filed #4286 about this. |
Thank you @DanTup for your time and efforts -- they are much appreciated 🙏🏽 |
np! Thanks for taking time to file issues and provide repros, it makes things much easier for me to track down and fix :-) |
Any updates ? Still happening very frequently. |
@louis-grimaldi this issue has been closed for a long time - if you're having trouble please open a new issue and include as much detail as you can. Thanks! |
Describe the bug
The bug usually occurs while creating new tests, moving them around or grouping them.. See screenshot below.
Reloading VS Code seems the only option atm to realign the buttons (closing/reopening the file does not help)
To Reproduce
Unable to reproduce at the moment. I've seen it multiple time
Expected behavior
The buttons should be aligned with tests.
Screenshots
Please complete the following information:
Additional Context
When I observed the issues, I had
"editor.codeLens": false"
in the VS Code settings. I've enabled the code lens now and I'll follow up with an update if the issue appears.Related Discord discussion (here)
The text was updated successfully, but these errors were encountered: