Skip to content

Commit 7adf004

Browse files
committed
Add a 50ms sleep for TestDomainsLicense issue
1 parent adc8cd1 commit 7adf004

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/Imageflow.Server.Tests/TestLicensing.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,19 @@ public async void TestDomainsLicense()
184184

185185
Assert.Empty(mgr.GetIssues());
186186

187+
Thread.Sleep(50); //In case this helps with async
188+
187189
url.Url = new Uri("https://unlicenseddomain.com");
188190
using var notLicensedResponse = await client.GetAsync("/fire.jpg?w=1");
191+
192+
// ON CI we sometimes get OK instead of 402 (Payment Required).
189193
Assert.Equal(HttpStatusCode.PaymentRequired,notLicensedResponse.StatusCode);
190194

191195

192196

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

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

0 commit comments

Comments
 (0)