diff --git a/test/Identity.IntegrationTest/Endpoints/IdentityServerTests.cs b/test/Identity.IntegrationTest/Endpoints/IdentityServerTests.cs index f29a09c6e2..b1e74bd17d 100644 --- a/test/Identity.IntegrationTest/Endpoints/IdentityServerTests.cs +++ b/test/Identity.IntegrationTest/Endpoints/IdentityServerTests.cs @@ -33,7 +33,7 @@ public class IdentityServerTests : IClassFixture using var body = await AssertHelper.AssertResponseTypeIs(context); var endpointRoot = body.RootElement; - // WARNING: Edits to this file should NOT just be made to "get the test to work" they should be made when intentional + // WARNING: Edits to this file should NOT just be made to "get the test to work" they should be made when intentional // changes were made to this endpoint and proper testing will take place to ensure clients are backwards compatible // or loss of functionality is properly noted. await using var fs = File.OpenRead("openid-configuration.json"); @@ -372,10 +372,10 @@ public class IdentityServerTests : IClassFixture } /// - /// This test currently does not test any code that is not covered by other tests but + /// This test currently does not test any code that is not covered by other tests but /// it shows that we probably have some dead code in /// for installation, organization, and user they split on a '.' but have already checked that at least one - /// '.' exists in the client_id by checking it with + /// '.' exists in the client_id by checking it with /// I believe that idParts.Length > 1 will ALWAYS return true /// [Fact] @@ -488,9 +488,9 @@ public class IdentityServerTests : IClassFixture } [Theory, BitAutoData] - public async Task TokenEndpoint_ToQuickInOneSecond_BlockRequest(string deviceId) + public async Task TokenEndpoint_TooQuickInOneSecond_BlockRequest(string deviceId) { - const int AmountInOneSecondAllowed = 5; + const int AmountInOneSecondAllowed = 10; // The rule we are testing is 10 requests in 1 second var username = "test+ratelimiting@email.com"; @@ -514,9 +514,9 @@ public class IdentityServerTests : IClassFixture } var responses = (await Task.WhenAll(tasks)).ToList(); + var blockResponses = responses.Where(c => c.Response.StatusCode == StatusCodes.Status429TooManyRequests); - Assert.Equal(5, responses.Count(c => c.Response.StatusCode == StatusCodes.Status200OK)); - Assert.Equal(1, responses.Count(c => c.Response.StatusCode == StatusCodes.Status429TooManyRequests)); + Assert.True(blockResponses.Count() > 0); Task MakeRequest() {