Skip to content

Commit

Permalink
Relax requirements on DSM transport tests (#4804)
Browse files Browse the repository at this point in the history
Because there's various race conditions, and these are super-flaky
  • Loading branch information
andrewlock authored Nov 3, 2023
1 parent 9cac76d commit 417ca16
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,15 @@ public async Task TransportsWorkCorrectly(Enum transport)

var result = agent.WaitForDataStreams(1);

var payload = result.Should().ContainSingle().Subject;
payload.Env.Should().Be("env");
payload.Service.Should().Be("service");
var headers = agent.DataStreamsRequestHeaders.Should().ContainSingle().Subject;
headers.AllKeys.ToDictionary(x => x, x => headers[x])
.Should()
.ContainKey("Content-Encoding", "gzip");
payload.Stats.Should().ContainSingle(s => s.Backlogs != null);
// we can't guarantee only having a single payload due to race conditions in the flushing code
result.Should().OnlyContain(payload => payload.Env == "env");
result.Should().OnlyContain(payload => payload.Service == "service");
agent.DataStreamsRequestHeaders
.Should()
.OnlyContain(
headers => headers.AllKeys.Contains("Content-Encoding")
&& headers["Content-Encoding"] == "gzip");
result.Should().OnlyContain(payload => payload.Stats.Count(s => s.Backlogs != null) == 1);
}

private StatsPoint CreateStatsPoint(long timestamp = 0)
Expand Down

0 comments on commit 417ca16

Please sign in to comment.