Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/validate_gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: gradle/wrapper-validation-action@v3
- uses: gradle/actions/wrapper-validation@v6
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public class DefaultNetworking implements Networking {
private Log L = null;

private Transport transport;
private Tasks tasks;
//package-private so tests can wait until a sent request was handled
Tasks tasks;
private volatile boolean shutdown;
private volatile boolean backedOff;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,8 @@ private static void awaitSentBatches() throws Exception {
for (int round = 0; round < 200; round++) {
awaitLogDelivery();
Assert.assertTrue("a queued batch never reached the server", TestUtils.waitFor(30_000, () -> storedBatchCount() == 0));
//the networking removes a sent batch before it lets the logger queue the next one
awaitNetworking();
awaitLogDelivery();
if (storedBatchCount() == 0) {
return;
Expand All @@ -904,6 +906,17 @@ private static void awaitSentBatches() throws Exception {
Assert.fail("the logger kept queueing batches");
}

/**
* Waits until the networking finished the task it was running, the handling of a sent request
* included.
*/
private static void awaitNetworking() {
SDKCore core = SDKCore.instance;
if (core != null && core.networking instanceof DefaultNetworking) {
((DefaultNetworking) core.networking).tasks.await();
}
}

/**
* The log batches stored on disk, read straight from the request files, which works once the
* SDK stopped too.
Expand Down
Loading