From adab76d0af3b0448f2bde186b81852a8e3ff3ea7 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Thu, 22 Oct 2026 23:37:06 +0300 Subject: [PATCH 1/2] Validate the Gradle wrapper with gradle/actions/wrapper-validation@v6 The archived gradle/wrapper-validation-action@v3 delegates to gradle/actions/wrapper-validation@v3.5.0, whose bundled checksums predate the wrapper JAR of this repository, so every run fetched them from services.gradle.org and a network timeout failed the check. v6 bundles the checksum of this JAR and validates it without a network call. --- .github/workflows/validate_gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate_gradle.yml b/.github/workflows/validate_gradle.yml index 2a38a5d8..bf0d1c9c 100644 --- a/.github/workflows/validate_gradle.yml +++ b/.github/workflows/validate_gradle.yml @@ -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 From 0c9f5874373e2d18d4b583de89c215cf654a00cf Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray Date: Fri, 23 Oct 2026 10:35:11 +0300 Subject: [PATCH 2/2] Wait for a sent log batch to be handed over before asserting it 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. --- .../count/sdk/java/internal/DefaultNetworking.java | 3 ++- .../sdk/java/internal/SdkLogGatheringTests.java | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/DefaultNetworking.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/DefaultNetworking.java index 10b00aab..f1e9ee22 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/DefaultNetworking.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/DefaultNetworking.java @@ -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; diff --git a/sdk-java/src/test/java/ly/count/sdk/java/internal/SdkLogGatheringTests.java b/sdk-java/src/test/java/ly/count/sdk/java/internal/SdkLogGatheringTests.java index 94a7db3d..fd502a1a 100644 --- a/sdk-java/src/test/java/ly/count/sdk/java/internal/SdkLogGatheringTests.java +++ b/sdk-java/src/test/java/ly/count/sdk/java/internal/SdkLogGatheringTests.java @@ -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; @@ -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.