Repository navigation
Closed
Labels
area-testTest discovery, execution, debuggingTest discovery, execution, debuggingbugSomething isn't workingSomething isn't working
Milestone
Description
Description
When a new [DataRow] is added to an existing [TestMethod], it is ignored when the test case is run from the gutter button. It has to be run a second time for the new data row to be picked up and actually tested. This can easily be missed when there are many data rows for the test case.
Issue Details
| Item | Value |
|---|---|
| Issue Category | Bug |
| Target | C# Dev Kit |
| Repository | microsoft/vscode-dotnettools |
| VS Code Version | Code 1.146.0 (69047191fc427f2f92828279aae1d90d8eeda7ab, 2026-11-10T19:27:51Z) |
| OS Version | Windows_NT x64 10.0.22631 |
| Extension Identifier | ms-dotnettools.csdevkit |
| Extension Version | 3.40.215 |
| Extension Publisher | ms-dotnettools |
System Info
| Item | Value |
|---|---|
| VS Code Version | Code 1.146.0 (69047191fc427f2f92828279aae1d90d8eeda7ab, 2026-11-10T19:27:51Z) |
| OS Version | Windows_NT x64 10.0.22631 |
| CPUs | AMD Ryzen 7 7700 8-Core Processor (16 x 3793) |
| GPU Status | 2d_canvas: unavailable_software GPU0: VENDOR= 0xffff [Google Inc. (Microsoft)], DEVICE=0xffff [ANGLE (Microsoft, Microsoft Basic Render Driver (0x0000008C) Direct3D11 vs_5_0 ps_5_0, D3D11-10.0.22621.4974)], DRIVER_VENDOR=SwANGLE, DRIVER_VERSION=10.0.22621.4974 ACTIVE Machine model name: Machine model version: direct_rendering_display_compositor: disabled_off_ok gpu_compositing: disabled_software multiple_raster_threads: enabled_on opengl: disabled_off rasterization: disabled_software raw_draw: disabled_off_ok skia_graphite: disabled_off trees_in_viz: disabled_off video_decode: disabled_software video_encode: disabled_software webgl: unavailable_software webgpu: unavailable_software webnn: unavailable_software |
| Load (avg) | |
| Memory (System) | 31.15GB (13.12GB free) |
| Process Argv | --crash-reporter-id 2f294617-6096-4790-bfd7-aa4b89027a78 |
| Screen Reader | no |
| VM | 20% |
| User Agent | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.146.0 Chrome/150.0.7871.250 Electron/43.8.6 Safari/537.36 |
| Installation pure | true |
A/B Experiments
vsliv368cf:30146710
pythonvspyt551:31249599
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
envsactivate1:31551504
cloudbuttont:31379625
3efgi100_wstrepl:31403338
839jf696:31457053
ec5jj548:31422691
cp_cls_t_966_ss:31526232
4je02754:31466945
c3h7c220:31478652
cp_cls_c_1081:31454833
conptydll_true:31498968
e9c30283:31461165
c9b86496:31447327
capico_a_098a3278:31590237
ei9d7968:31496641
chat:31457767
8hig5102:31480529
89g7j272:31518289
2d1bi976:31596492
i2gc6536:31499202
52612955:31516516
ddid_c:31478207
hmra_i5g22:31518061
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
j0d79568:31499440
jb_cp_cls_t_632:31543129
56dj4588:31512888
32d76977:31512328
ha629193:31508444
a1ije391_t:31540920
jbcp_cls_pctr_t:31531130
cp_intellij_t_nes:31548657
ahp-both-windows:31556933
ihg5j128:31534457
7g2b5551:31542111
nes-ex-cf-euporie-03:31542868
enable_editor_pane_layout:31569726
allow-none:31555437
36h42362:31564511
1h923230:31564177
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
0d8dfbc3:31570291
0c1h4866:31566224
session-mark-done:31591648
plus-and-new:31602494
multi-root:31593626
5b8j3302:31564601
autotiers:31584978
mangle-name-control:31572633
atk_rai_validation_enable:31616613
allow-signed-out:31592042
intellij_nes_preview_t:31580086
39a5d156:31574986
issue9151-8b8b39eb:31597539
usage_tips_endabled_0911:31587631
codex-agent-host-stable-editor:31599810
9b7i0944:31600022
skill-budget-30000:31597277
5a177259:31599157
i67i8290:31599156
edbgf432:31599155
1664414a:31611794
2b2dee84:31611795
msft-auth-on:31593345
codex-continuation-treatment:31605234
ensemble_enabled:31616745
variation8-original-feedback:31600301
early-preparation-enabled:31610674
362a2c54:31616739
5089303b:31616861
permission_prompt_treatment:1332566
ccr_pr_nudge_control:1467213
vsc_wsm_c:1340633
1g5a5742:1379227
4cj51803:1433348
5i7gb129:1482819
cmc_aa_c:1435710
canvases-enabled:1476219
t_ws_f7ce1948:1455090
2ca6g807:1469189
seatcta-d9cadb09:1462477
22h9j369:1486668
st_ar_264dh868:1460017
57heh152:1498990
ghuitreatment2:1482850
prewarm_treatment:1484693
ctid-aa-t:1469309
titlebar-rich-hover-control:1479476
githubexp-exposure-services:1484840
remotes-this-computer-treatment:1501158
devaa-control:1492395
welcome-graphic-pick-auto:1494400
parallel-banner-reveal-control:1496079
move-chats-enabled:1501203
Metadata
Metadata
Assignees
Labels
area-testTest discovery, execution, debuggingTest discovery, execution, debuggingbugSomething isn't workingSomething isn't working
Activity
drewnoakes commentedon Nov 15, 2026
Peter Waldschmidt (@peterwald) do we handle this better in 11? This used to happen in VS too. It can cause you to think tests are passing when they're actually failing.
peterwald commentedon Nov 16, 2026
This is caused by the fact that clicking the run button in the gutter runs the specific tests that the testing panel is currently aware of. If a compile and discovery cycle is required for the testing panel to be aware of the test, then it is too late and the test is not run. In v11, we have source-based test discovery which discovers the test when the file is saved. So as long as source-based test discovery is working, we don't have this problem.
I have tested the latest C# Dev Kit extension and it was correctly running all of the data driven tests when I added a new datarow and saved before clicking the run button in the gutter.
ygoe commentedon Nov 16, 2026
I have version 3.40.215 installed and .NET SDK 10.0.403 (and 9.0.320) and cannot reproduce the fix. Newly added rows are still ignored after saving the file. Can you please be more specific which version of C# Dev Kit and the .NET SDK I need?
BTW, Visual Studio saves all files when debugging the project. I see this also happens when clicking the test button in the gutter in VSCode. Does this satisfy the requirement that the file must be saved before running the tests or is it too late? If it's too late, can the order be changed internally so that this file save is sufficient? That would be ideal because then the user wouldn't need to think about it anymore.
peterwald commentedon Nov 16, 2026
You would need the pre-release build of C# Dev Kit which is currently version 11.11.98 (see https://devblogs.microsoft.com/dotnet/faster-lighter-csharp-dev-kit/)
VS Code does save the file when running tests, however this happens after it selects the test, so if you click the test button before saving then it will run prior test list, not the new ones. We might be able to avoid this if we moved source-based test discovery into the language server's live editor workspace.
peterwald commentedon Nov 18, 2026
I actually did some more testing, and it appears that it does run the correct tests after editing when source-based discovery is active. Closing this issue out based on this finding. Let us know if you get a chance to try it and see how it works for you.
ygoe commentedon Nov 18, 2026
Well, I switched to the C# Dev Kit preview, version 11.11.98, and now I cannot run tests any more. No tests are discovered. I guess that's not the solution you had thought of.
peterwald commentedon Nov 18, 2026
Are there any useful error logs in the Output panel under the C# Dev Kit - Test Explorer section?
ygoe commentedon Nov 18, 2026
That doesn't exist, only "C# Dev Kit":
peterwald commentedon Nov 18, 2026
Looks like the extension is not initializing because it needs an updated version of the C# extension to match. You will need the pre-release version of the C# extension as well.
ygoe commentedon Nov 18, 2026
Yes, now it looks good, the newly added data row is run immediately, no explicit save needed. Thank you!
I also like how the data rows are now nested in the test tree.