Skip to content

Commit

Permalink
Fix flakiness (Azure#44454)
Browse files Browse the repository at this point in the history
  • Loading branch information
christothes authored Jun 10, 2024
1 parent c73ac5e commit 35726c2
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@ public async Task BearerTokenAuthenticationPolicy_TokenAlmostExpired()

await SendGetRequest(transport, policy, uri: new Uri("https://example.com/4/AfterRefresh"));

Assert.AreEqual(2, callCount);

Assert.True(transport.Requests[0].Headers.TryGetValue("Authorization", out string auth1Value));
Assert.True(transport.Requests[1].Headers.TryGetValue("Authorization", out string auth2Value));
Assert.True(transport.Requests[2].Headers.TryGetValue("Authorization", out string auth3Value));
Expand All @@ -263,6 +261,7 @@ public async Task BearerTokenAuthenticationPolicy_TokenAlmostExpired()
Assert.AreEqual(auth1Value, auth2Value);
Assert.AreEqual(auth2Value, auth3Value);
Assert.AreNotEqual(auth3Value, auth4Value);
Assert.GreaterOrEqual(callCount, 2);
}

[Test]
Expand Down Expand Up @@ -300,8 +299,6 @@ public async Task BearerTokenAuthenticationPolicy_TokenNotAlmostExpiredWithRefre

await SendGetRequest(transport, policy, uri: new Uri("https://example.com/4/AfterRefresh"));

Assert.AreEqual(2, callCount);

Assert.True(transport.Requests[0].Headers.TryGetValue("Authorization", out string auth1Value));
Assert.True(transport.Requests[1].Headers.TryGetValue("Authorization", out string auth2Value));
Assert.True(transport.Requests[2].Headers.TryGetValue("Authorization", out string auth3Value));
Expand All @@ -310,6 +307,7 @@ public async Task BearerTokenAuthenticationPolicy_TokenNotAlmostExpiredWithRefre
Assert.AreEqual(auth1Value, auth2Value);
Assert.AreEqual(auth2Value, auth3Value);
Assert.AreNotEqual(auth3Value, auth4Value);
Assert.GreaterOrEqual(callCount, 2);
}

[Test]
Expand Down

0 comments on commit 35726c2

Please sign in to comment.