File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
test/SeqCli.EndToEnd/Support Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,19 @@ static async Task WaitForForwarderConnectionAsync(string forwarderApiListenUri)
5555
5656 while ( true )
5757 {
58+ cts . Token . ThrowIfCancellationRequested ( ) ;
59+
5860 var content = new StringContent ( "" , new MediaTypeHeaderValue ( "application/vnd.serilog.clef" , "utf-8" ) ) ;
5961
6062 try
6163 {
62- var ingestionResult = await httpClient . PostAsync ( ingestEndpoint , content , cts . Token ) ;
64+ using var shortCts = CancellationTokenSource . CreateLinkedTokenSource ( cts . Token ) ;
65+ shortCts . CancelAfter ( TimeSpan . FromSeconds ( 1 ) ) ;
66+
67+ var ingestionResult = await httpClient . PostAsync ( ingestEndpoint , content , shortCts . Token ) ;
6368 if ( ingestionResult . IsSuccessStatusCode )
6469 return ;
70+
6571 Log . Information ( "Waiting for forwarder API to become available; last result {StatusCode}" , ingestionResult . StatusCode ) ;
6672 }
6773 catch ( Exception ex )
You can’t perform that action at this time.
0 commit comments