Skip to content

Commit 328c169

Browse files
authored
Fix flake in AgentWriterTests (#9052)
## Summary of changes Reduces the risk of flake in `AgentWriterTests` ## Reason for change #9007 added some additional tests, but they flaked in CI, and I failed to push this fix up before the auto-merge kicked in 🤦 ## Implementation details Reduce the load in the test to reduce the risk of flake in CI ## Test coverage The test is just a smoke test, it doesn't give any other guarantees, so there's no point in going crazy. If it continues to flake, we can always just remove it.
1 parent f33ee47 commit 328c169

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tracer/test/Datadog.Trace.Tests/Agent/AgentWriterTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,9 @@ public async Task ConcurrentFlushTracesAsync_NeverRunsMoreThanOneFlushAtATime()
704704
maxConcurrentSends = Math.Max(maxConcurrentSends, current);
705705
}
706706

707-
// Give any other flush a chance to overlap with this one
708-
await Task.Delay(20);
707+
// Give any other flush a chance to overlap with this one, but not too big,
708+
// otherwise could cause flake
709+
await Task.Delay(5);
709710

710711
Interlocked.Decrement(ref concurrentSends);
711712
return true;
@@ -719,7 +720,7 @@ public async Task ConcurrentFlushTracesAsync_NeverRunsMoreThanOneFlushAtATime()
719720

720721
var flushes = new List<Task>();
721722

722-
for (var i = 0; i < 50; i++)
723+
for (var i = 0; i < 10; i++)
723724
{
724725
agent.WriteTrace(CreateTraceChunk(1));
725726
flushes.Add(agent.FlushTracesAsync());

0 commit comments

Comments
 (0)