Skip to content

Commit

Permalink
Add a 50ms sleep for TestDomainsLicense issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Aug 23, 2022
1 parent adc8cd1 commit 7adf004
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/Imageflow.Server.Tests/TestLicensing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,19 @@ public async void TestDomainsLicense()

Assert.Empty(mgr.GetIssues());

Thread.Sleep(50); //In case this helps with async

url.Url = new Uri("https://unlicenseddomain.com");
using var notLicensedResponse = await client.GetAsync("/fire.jpg?w=1");

// ON CI we sometimes get OK instead of 402 (Payment Required).
Assert.Equal(HttpStatusCode.PaymentRequired,notLicensedResponse.StatusCode);



url.Url = new Uri("https://acme.com");
using var licensedResponse1 = await client.GetAsync("/fire.jpg?w=1");
licensedResponse1.EnsureSuccessStatusCode(); // ON CI once got System.Net.Http.HttpRequestException : Response status code does not indicate success: 402 (Payment Required).
licensedResponse1.EnsureSuccessStatusCode(); // ON CI we sometimes get System.Net.Http.HttpRequestException : Response status code does not indicate success: 402 (Payment Required).

url.Url = new Uri("https://acmestaging.com");
using var licensedResponse2 = await client.GetAsync("/fire.jpg?w=1");
Expand Down

0 comments on commit 7adf004

Please sign in to comment.