Skip to content

Commit df795be

Browse files
committed
increase timeout for AppBar_Change_Theme_ReloadPage
1 parent ba41dc1 commit df795be

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

tests/Aspire.Dashboard.Tests/Integration/Playwright/AppBarTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ await AsyncTestHelpers.AssertIsTrueRetryAsync(
6565
}
6666

6767
[Fact]
68-
[ActiveIssue("https://github.com/dotnet/aspire/issues/9152", typeof(PlatformDetection), nameof(PlatformDetection.IsMacOS))]
6968
public async Task AppBar_Change_Theme_ReloadPage()
7069
{
7170
// Arrange
@@ -104,7 +103,8 @@ await Assertions
104103

105104
await AsyncTestHelpers.AssertIsTrueRetryAsync(
106105
async () => await checkbox.IsCheckedAsync(),
107-
"Checkbox isn't immediately checked.");
106+
"Checkbox isn't immediately checked.",
107+
retries: 15 /* this seems to take a very long time, but eventually succeeds */);
108108
}
109109
});
110110
}

tests/Shared/AsyncTestHelpers.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,11 @@ public static Task AssertIsTrueRetryAsync(Func<bool> assert, string message, ILo
200200
return AssertIsTrueRetryAsync(() => Task.FromResult(assert()), message, logger);
201201
}
202202

203-
public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null)
203+
public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string message, ILogger? logger = null, int retries = 10)
204204
{
205-
const int Retries = 10;
206-
207205
logger?.LogInformation("Start: " + message);
208206

209-
for (var i = 0; i < Retries; i++)
207+
for (var i = 0; i < retries; i++)
210208
{
211209
if (i > 0)
212210
{
@@ -220,6 +218,6 @@ public static async Task AssertIsTrueRetryAsync(Func<Task<bool>> assert, string
220218
}
221219
}
222220

223-
throw new InvalidOperationException($"Assert failed after {Retries} retries: {message}");
221+
throw new InvalidOperationException($"Assert failed after {retries} retries: {message}");
224222
}
225223
}

0 commit comments

Comments
 (0)