@@ -50,7 +50,7 @@ public sealed record CollectArgs(
50
50
[ MemberData ( nameof ( BasicCases ) ) ]
51
51
public async Task CollectCommandProviderConfigurationConsolidation ( CollectArgs args , string [ ] expectedSubset )
52
52
{
53
- MockConsole console = new ( 200 , 30 ) { IsOutputRedirected = false } ;
53
+ MockConsole console = new ( 200 , 30 ) ;
54
54
string [ ] rawLines = await RunAsync ( args , console ) . ConfigureAwait ( true ) ;
55
55
console . AssertSanitizedLinesEqual ( CollectSanitizer , expectedSubset ) ;
56
56
@@ -63,7 +63,7 @@ private static async Task<string[]> RunAsync(CollectArgs config, MockConsole con
63
63
var handler = new CollectCommandHandler ( ) ;
64
64
handler . StartTraceSessionAsync = ( client , cfg , ct ) => Task . FromResult < CollectCommandHandler . ICollectSession > ( new TestCollectSession ( ) ) ;
65
65
handler . ResumeRuntimeAsync = ( client , ct ) => Task . CompletedTask ;
66
- handler . CollectSessionEventStream = ( name ) => new SlowSinkStream ( config . EventStream ) ;
66
+ handler . CollectSessionEventStream = ( name ) => config . EventStream ;
67
67
handler . Console = console ;
68
68
handler . GetFileLength = ( path ) => Encoding . UTF8 . GetByteCount ( ExpectedPayload ) ;
69
69
@@ -96,32 +96,6 @@ private static async Task<string[]> RunAsync(CollectArgs config, MockConsole con
96
96
return console . Lines ;
97
97
}
98
98
99
- // As the test payload is small, we need to delay writes to the output stream to ensure
100
- // that the status update logic in CollectCommandHandler has a chance to run.
101
- private sealed class SlowSinkStream : Stream
102
- {
103
- private readonly Stream _inner ;
104
-
105
- public SlowSinkStream ( Stream inner ) { _inner = inner ; }
106
-
107
- public override bool CanRead => false ;
108
- public override bool CanSeek => false ;
109
- public override bool CanWrite => true ;
110
- public override long Length => throw new NotSupportedException ( ) ;
111
- public override long Position { get => throw new NotSupportedException ( ) ; set => throw new NotSupportedException ( ) ; }
112
-
113
- public override void Flush ( ) { }
114
- public override int Read ( byte [ ] buffer , int offset , int count ) => throw new NotSupportedException ( ) ;
115
- public override long Seek ( long offset , SeekOrigin origin ) => throw new NotSupportedException ( ) ;
116
- public override void SetLength ( long value ) => throw new NotSupportedException ( ) ;
117
- public override void Write ( byte [ ] buffer , int offset , int count ) => _inner . Write ( buffer , offset , count ) ;
118
- public override async Task WriteAsync ( byte [ ] buffer , int offset , int count , CancellationToken cancellationToken )
119
- {
120
- await Task . Delay ( 200 , cancellationToken ) . ConfigureAwait ( false ) ;
121
- await _inner . WriteAsync ( buffer , offset , count , cancellationToken ) . ConfigureAwait ( false ) ;
122
- }
123
- }
124
-
125
99
private static string [ ] CollectSanitizer ( string [ ] lines )
126
100
{
127
101
List < string > result = new ( ) ;
@@ -131,10 +105,6 @@ private static string[] CollectSanitizer(string[] lines)
131
105
{
132
106
result . Add ( "Process : <PROCESS>" ) ;
133
107
}
134
- else if ( line . StartsWith ( '[' ) && line . Contains ( "Recording trace" ) )
135
- {
136
- result . Add ( "[dd:hh:mm:ss]\t " + line . Substring ( 14 ) ) ;
137
- }
138
108
else
139
109
{
140
110
result . Add ( line ) ;
@@ -250,8 +220,7 @@ public static IEnumerable<object[]> BasicCases()
250
220
private static readonly string [ ] CommonTail = [
251
221
"Process : <PROCESS>" ,
252
222
outputFile ,
253
- "[dd:hh:mm:ss]\t Recording trace 38.00 (B)" ,
254
- "Press <Enter> or <Ctrl+C> to exit..." ,
223
+ "" ,
255
224
"\n Trace completed."
256
225
] ;
257
226
0 commit comments