Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition in TelemetryControllerSchedulerTests #6514

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="TelemetryControllerSchedulerTests.cs" company="Datadog">
// <copyright file="TelemetryControllerSchedulerTests.cs" company="Datadog">
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>
Expand Down Expand Up @@ -162,6 +162,8 @@ public async Task TypicalLoop_WithLogsQueueTrigger()
delayMutex.Wait();
queueTcs.SetResult(true); // this triggers the queue task

await waitTask;

// t = 15s;
_scheduler.ShouldFlushTelemetry.Should().BeFalse(); // not a complete interval
_scheduler.ShouldFlushRedactedErrorLogs.Should().BeTrue(); // triggered by queue
Expand All @@ -180,7 +182,7 @@ public async Task TypicalLoop_WithLogsQueueTrigger()
// t = 125s;
_scheduler.ShouldFlushTelemetry.Should().BeTrue();
_scheduler.ShouldFlushRedactedErrorLogs.Should().BeTrue();
}
}

[Fact]
public async Task DoesNotFlushTelemetryUntilInitialized()
Expand Down
Loading