@@ -24,13 +24,13 @@ public IntegrationServicesTests(ITestOutputHelper testOutput, IntegrationService
2424 [ InlineData ( TestResourceNames . efnpgsql ) ]
2525 [ InlineData ( TestResourceNames . redis ) ]
2626 public Task VerifyComponentWorks ( TestResourceNames resourceName )
27- => RunTestAsync ( async ( ) =>
27+ => RunTestAsync ( async ( cancellationToken ) =>
2828 {
2929 _integrationServicesFixture . EnsureAppHasResources ( resourceName ) ;
3030 try
3131 {
32- var response = await _integrationServicesFixture . IntegrationServiceA . HttpGetAsync ( "http" , $ "/{ resourceName } /verify") ;
33- var responseContent = await response . Content . ReadAsStringAsync ( ) ;
32+ var response = await _integrationServicesFixture . IntegrationServiceA . HttpGetAsync ( "http" , $ "/{ resourceName } /verify", cancellationToken ) ;
33+ var responseContent = await response . Content . ReadAsStringAsync ( cancellationToken ) ;
3434
3535 Assert . True ( response . IsSuccessStatusCode , responseContent ) ;
3636 }
@@ -44,23 +44,24 @@ public Task VerifyComponentWorks(TestResourceNames resourceName)
4444 [ Fact ]
4545 [ Trait ( "scenario" , "basicservices" ) ]
4646 public Task VerifyHealthyOnIntegrationServiceA ( )
47- => RunTestAsync ( async ( ) =>
47+ => RunTestAsync ( async ( cancellationToken ) =>
4848 {
4949 // We wait until timeout for the /health endpoint to return successfully. We assume
5050 // that components wired up into this project have health checks enabled.
51- await _integrationServicesFixture . IntegrationServiceA . WaitForHealthyStatusAsync ( "http" , _testOutput ) ;
51+ await _integrationServicesFixture . IntegrationServiceA . WaitForHealthyStatusAsync ( "http" , _testOutput , cancellationToken ) ;
5252 } ) ;
5353
54- private async Task RunTestAsync ( Func < Task > test )
54+ private async Task RunTestAsync ( Func < CancellationToken , Task > test )
5555 {
5656 _integrationServicesFixture . Project . EnsureAppHostRunning ( ) ;
57+ var cancellationToken = TestContext . Current . CancellationToken ;
5758 try
5859 {
59- await test ( ) ;
60+ await test ( cancellationToken ) ;
6061 }
6162 catch
6263 {
63- await _integrationServicesFixture . Project . DumpDockerInfoAsync ( ) ;
64+ await _integrationServicesFixture . Project . DumpDockerInfoAsync ( cancellationToken : cancellationToken ) ;
6465 throw ;
6566 }
6667 }
0 commit comments