|
12 | 12 |
|
13 | 13 | namespace Azure.Mcp.Tools.ManagedLustre.LiveTests; |
14 | 14 |
|
15 | | -public partial class ManagedLustreCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) : RecordedCommandTestsBase(output, fixture, liveServerFixture) |
| 15 | +public partial class ManagedLustreCommandTests(ITestOutputHelper output, TestProxyFixture fixture, LiveServerFixture liveServerFixture) |
| 16 | + : RecordedCommandTestsBase(output, fixture, liveServerFixture) |
16 | 17 | { |
17 | 18 | private static readonly string[] _sanitizedHeaders = |
18 | 19 | [ |
@@ -232,7 +233,7 @@ public async Task Should_create_azure_managed_lustre_with_storage_and_cmk() |
232 | 233 |
|
233 | 234 | // Wait for filesystem to be available before creating jobs |
234 | 235 | var maxWaitTime = TimeSpan.FromMinutes(30); |
235 | | - var pollInterval = TestMode == TestMode.Playback ? TimeSpan.FromMilliseconds(100) : TimeSpan.FromSeconds(30); |
| 236 | + var pollInterval = PollInterval(30_000); |
236 | 237 | var startTime = DateTime.UtcNow; |
237 | 238 | var isAvailable = false; |
238 | 239 |
|
@@ -271,7 +272,7 @@ public async Task Should_create_azure_managed_lustre_with_storage_and_cmk() |
271 | 272 | Assert.True(isAvailable, $"Filesystem '{fsName}' did not reach 'Succeeded' provisioning state within {maxWaitTime.TotalMinutes} minutes."); |
272 | 273 |
|
273 | 274 | // Wait for filesystem to stabilize before creating jobs |
274 | | - await Task.Delay(TestMode == TestMode.Playback ? TimeSpan.FromMilliseconds(100) : TimeSpan.FromSeconds(15), TestContext.Current.CancellationToken); |
| 275 | + await Task.Delay(PollInterval(15_000), TestContext.Current.CancellationToken); |
275 | 276 |
|
276 | 277 | // Test autoimport job lifecycle |
277 | 278 | var autoimportJobNameStr = $"autoimport-{fsName}"; |
@@ -336,7 +337,7 @@ public async Task Should_create_azure_managed_lustre_with_storage_and_cmk() |
336 | 337 | Assert.Contains(autoimportJobNameStr, autoimportJobText); |
337 | 338 |
|
338 | 339 | // Wait 15 seconds to cancel auto import job |
339 | | - await Task.Delay(TestMode == TestMode.Playback ? TimeSpan.FromMilliseconds(100) : TimeSpan.FromSeconds(15), TestContext.Current.CancellationToken); |
| 340 | + await Task.Delay(PollInterval(15_000), TestContext.Current.CancellationToken); |
340 | 341 |
|
341 | 342 | // Cancel autoimport job |
342 | 343 | var autoimportCancelResult = await CallToolAsync( |
@@ -373,7 +374,7 @@ public async Task Should_create_azure_managed_lustre_with_storage_and_cmk() |
373 | 374 | Assert.Equal("Deleted", autoimportDeleteStatus.GetString()); |
374 | 375 |
|
375 | 376 | // Wait for filesystem to stabilize after deleting import job and before creating export job |
376 | | - await Task.Delay(TestMode == TestMode.Playback ? TimeSpan.FromMilliseconds(100) : TimeSpan.FromSeconds(15), TestContext.Current.CancellationToken); |
| 377 | + await Task.Delay(PollInterval(15_000), TestContext.Current.CancellationToken); |
377 | 378 |
|
378 | 379 | // Test autoexport job lifecycle. |
379 | 380 | var autoexportJobNameStr = $"autoexport-{fsName}"; |
@@ -436,7 +437,7 @@ public async Task Should_create_azure_managed_lustre_with_storage_and_cmk() |
436 | 437 | Assert.Contains(autoexportJobNameStr, autoexportJobText); |
437 | 438 |
|
438 | 439 | // Wait 15 seconds to cancel auto export job. |
439 | | - await Task.Delay(TestMode == TestMode.Playback ? TimeSpan.FromMilliseconds(100) : TimeSpan.FromSeconds(15), TestContext.Current.CancellationToken); |
| 440 | + await Task.Delay(PollInterval(15_000), TestContext.Current.CancellationToken); |
440 | 441 | // Cancel autoexport job |
441 | 442 | var autoexportCancelResult = await CallToolAsync( |
442 | 443 | "managedlustre_fs_blob_autoexport_cancel", |
@@ -472,7 +473,7 @@ public async Task Should_create_azure_managed_lustre_with_storage_and_cmk() |
472 | 473 | Assert.Equal("Deleted", autoexportDeleteStatus.GetString()); |
473 | 474 |
|
474 | 475 | // Wait for filesystem to stabilize after deleting autoexport job and before creating import job |
475 | | - await Task.Delay(TestMode == TestMode.Playback ? TimeSpan.FromMilliseconds(100) : TimeSpan.FromSeconds(15), TestContext.Current.CancellationToken); |
| 476 | + await Task.Delay(PollInterval(15_000), TestContext.Current.CancellationToken); |
476 | 477 |
|
477 | 478 | // Test import job lifecycle |
478 | 479 | var importJobNameStr = $"import-{fsName}"; |
|
0 commit comments