File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed
tests/SocketIOClient.UnitTests/V2 Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ public async Task ConnectAsync(CancellationToken cancellationToken)
8383 // TODO: concurrent connect
8484 _connCompletionSource = new TaskCompletionSource < Exception > ( ) ;
8585 _sessionCompletionSource = new TaskCompletionSource < bool > ( ) ;
86+ cancellationToken . Register ( ( ) => _connCompletionSource . SetResult ( new TaskCanceledException ( ) ) ) ;
8687 _ = ConnectCoreAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
8788 var task = Task . Run ( async ( ) => await _connCompletionSource . Task . ConfigureAwait ( false ) , cancellationToken ) ;
8889 var ex = await task . ConfigureAwait ( false ) ;
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ await _io
187187 }
188188
189189 [ Fact ]
190- public async Task ConnectAsyncCancellationToken_CancelAfter200ms_ThrowConnectionException ( )
190+ public async Task ConnectAsyncCancellationToken_CancelAfter100ms_ThrowOperationCanceledException ( )
191191 {
192192 _io . Options . Reconnection = true ;
193193 _random . Next ( Arg . Any < int > ( ) ) . Returns ( 10 ) ;
You can’t perform that action at this time.
0 commit comments