Commit 852c6b6
[Test] Fix collect command test race condition with status printer (dotnet#5787)
The CollectCommandFunctionalTests substitute a MemoryStream for the
output file stream, so the trace file is never created on disk. The
interactive status-printing path is non-deterministic in these tests
because the MemoryStream-backed session completes near-instantly, and
whether the status line fires before the loop exits depends on thread
scheduling. When it does fire, FileInfo.Length throws because the file
does not exist.
Set IsOutputRedirected=true on MockConsole to disable the status path.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 455cd12 commit 852c6b6
2 files changed
Lines changed: 7 additions & 3 deletions
File tree
- src
- Tools/dotnet-trace/CommandLine/Commands
- tests/dotnet-trace
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
389 | 388 | | |
390 | 389 | | |
391 | 390 | | |
| |||
399 | 398 | | |
400 | 399 | | |
401 | 400 | | |
402 | | - | |
403 | | - | |
| 401 | + | |
404 | 402 | | |
405 | 403 | | |
406 | 404 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
| |||
0 commit comments