Repository navigation
Wait for a sent log batch to be handed over before asserting it - #324
Closed
arifBurakDemiray wants to merge 1 commit into
Closed
arifBurakDemiray wants to merge 1 commit into
arifBurakDemiray wants to merge 1 commit into
Conversation
The networking removes a sent log batch and only then lets the logger
queue the next one, so the tests' wait for sent batches could end in
between and find lines still held ("expected:<0> but was:<475>" on CI).
It now also waits for the networking task that sent the batch, for which
DefaultNetworking.tasks is package-private.
Dependency security scanScanned 25 resolved dependencies, failing on HIGH and above. Result: passed |
Code coverage
Files changed by this pull request
Least covered classes (10 shown)
|
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
SdkLogGatheringTests.trackingOffHold_keepsTheNewest500Lines_andDAccountsForEveryDroppedLinefailed on #323's ubuntu run at line 201: lines were still held after the test waited for every batch to be sent.The send callback in
DefaultNetworkingremoves a sent log batch, then callsLog.onLogBatchSent(), which lets the logger queue the next one.awaitSentBatcheswaited for the stored batches to reach zero, so it could end between those two steps and see no batch on disk while the logger still held lines.awaitSentBatchesnow also waits for the networking task that sent the batch (its callback runs inside it), then for the log delivery.DefaultNetworking.tasksis package-private for that; nothing else changes in the SDK.Verified
onLogBatchSent(), the old wait fails this test (expected:<0> but was:<475>) andarmedDirective_uploadsTheInitLinesOfItsLevels_withTheGatherIdInBatchesOfAtMostB; the new wait passes all 13 tests of the class.🤖 Generated with Claude Code