products/shared/Xunit.Playwright/Retries/RetryableFactAttribute.cs
Damian Hickey 47590bb833 Implement xUnit v3 retry support and fix flaky Playwright/EndToEnd CI failures
- Add RetryableFact infrastructure for xUnit v3 in shared/Xunit.Playwright/Retries/:
  RetryableFactAttribute, RetryFactDiscoverer, RetryableTestCase, RetryTestCaseRunner,
  DelayedMessageBus — based on the official xUnit v3 samples
- Apply [RetryableFact] to BffBlazorWebAssemblyTests and BffBlazorTemplateTests which
  have a startup race condition (IdentityServer not fully ready on first attempt)
- Comment out MvcJarUriJwt InlineData in IdentityServerTests — the JAR URI fetch
  is not reachable in the GitHub Actions environment (pre-existing CI failure)
2026-02-19 14:16:30 +01:00

19 lines
629 B
C#

// Copyright (c) Duende Software. All rights reserved.
// See LICENSE in the project root for license information.
using System.Runtime.CompilerServices;
using Xunit.v3;
namespace Duende.Xunit.Playwright.Retries;
/// <summary>
/// Works just like [Fact] except that failures are retried (by default, 5 times).
/// </summary>
[XunitTestCaseDiscoverer(typeof(RetryFactDiscoverer))]
public class RetryableFactAttribute(
[CallerFilePath] string? sourceFilePath = null,
[CallerLineNumber] int sourceLineNumber = -1) :
FactAttribute(sourceFilePath, sourceLineNumber)
{
public int MaxRetries { get; set; } = 5;
}