File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
tests/Aspire.Hosting.Oracle.Tests Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,15 @@ public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume)
145145 // Seed database
146146 dbContext . Cars . Add ( new TestDbContext . Car { Brand = "BatMobile" } ) ;
147147 await dbContext . SaveChangesAsync ( cts . Token ) ;
148+
149+ await app . StopAsync ( ) ;
150+
151+ // Wait for the database to not be available before attempting to clean the volume.
152+
153+ await pipeline . ExecuteAsync ( async token =>
154+ {
155+ return ! await dbContext . Database . CanConnectAsync ( token ) ;
156+ } , cts . Token ) ;
148157 }
149158 }
150159 finally
@@ -193,6 +202,15 @@ public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume)
193202
194203 var brands = await dbContext . Cars . ToListAsync ( cancellationToken : cts . Token ) ;
195204 Assert . Single ( brands ) ;
205+
206+ await app . StopAsync ( ) ;
207+
208+ // Wait for the database to not be available before attempting to clean the volume.
209+
210+ await pipeline . ExecuteAsync ( async token =>
211+ {
212+ return ! await dbContext . Database . CanConnectAsync ( token ) ;
213+ } , cts . Token ) ;
196214 }
197215 }
198216 finally
You can’t perform that action at this time.
0 commit comments