Skip to content

Fix flaky pull-request job by honoring GetLastKeys arguments#74

Merged
brunobritodev merged 2 commits into
masterfrom
copilot/fix-pull-request-job-failure
Jul 16, 2026
Merged

Fix flaky pull-request job by honoring GetLastKeys arguments#74
brunobritodev merged 2 commits into
masterfrom
copilot/fix-pull-request-job-failure

Conversation

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The pull-request workflow was failing on JwtServiceTest.ShouldGenerateFiveKeys. The failure came from JwtService.GetLastKeys(...) ignoring the requested count and from in-memory tests sharing mutable global state across classes.

  • Service behavior

    • Make JwtService.GetLastKeys(int? i = null) use the caller-provided count instead of always falling back to AlgorithmsToKeep.
    • Make JwtService.GetLastKeys(int i, JwtKeyType jwtKeyType) pass through the requested i unchanged.
  • Test coverage

    • Update ShouldGenerateFiveKeys to query only JWS keys and assert the expected count explicitly.
    • Add a focused assertion in store tests covering the mixed JWS/JWE case, so the default overload continues to return both key types while respecting the requested quantity.
  • In-memory test isolation

    • Group in-memory store test classes into a shared xUnit collection to prevent cross-class parallel execution against the same static store.
public Task<ReadOnlyCollection<KeyMaterial>> GetLastKeys(int? i = null)
{
    return _store.GetLastKeys(i ?? _options.Value.AlgorithmsToKeep, null);
}

public Task<ReadOnlyCollection<KeyMaterial>> GetLastKeys(int i, JwtKeyType jwtKeyType)
{
    return _store.GetLastKeys(i, jwtKeyType);
}

Copilot AI changed the title [WIP] Fix failing GitHub Actions job 'pull-request' Fix flaky pull-request job by honoring GetLastKeys arguments Jul 13, 2026
Copilot AI requested a review from brunobritodev July 13, 2026 16:05
@brunobritodev
brunobritodev marked this pull request as ready for review July 16, 2026 15:10
@brunobritodev
brunobritodev merged commit b90e925 into master Jul 16, 2026
1 check passed
@brunobritodev
brunobritodev deleted the copilot/fix-pull-request-job-failure branch July 16, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants