diff --git a/.github/workflows/GHA-Unit-Tests.yaml b/.github/workflows/GHA-Unit-Tests.yaml index 3d0e52f03d..4e593ff7ef 100644 --- a/.github/workflows/GHA-Unit-Tests.yaml +++ b/.github/workflows/GHA-Unit-Tests.yaml @@ -79,7 +79,7 @@ jobs: - name: Capture build reports (non forked) # If previous step fails, run this step regardless -# if: failure() + if: failure() uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # pin@v4 with: name: non-forked-tests-results-java-${{ matrix.java-version }} @@ -126,7 +126,7 @@ jobs: **/build/reports/jacoco/** - name: Capture build reports (forked) -# if: failure() + if: failure() uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # pin@v4 with: name: forked-tests-results-java-${{ matrix.java-version }} diff --git a/newrelic-agent/src/main/java/com/newrelic/agent/service/async/AsyncTransactionService.java b/newrelic-agent/src/main/java/com/newrelic/agent/service/async/AsyncTransactionService.java index 992863ef60..7adefd8d76 100644 --- a/newrelic-agent/src/main/java/com/newrelic/agent/service/async/AsyncTransactionService.java +++ b/newrelic-agent/src/main/java/com/newrelic/agent/service/async/AsyncTransactionService.java @@ -184,10 +184,6 @@ protected int cacheSizeForTesting() { return PENDING_ACTIVITIES.asMap().size(); } - protected long getTimeoutMillisForTesting() { - return PENDING_ACTIVITIES.policy().expireAfterWrite().get().getExpiresAfter(TimeUnit.MILLISECONDS); - } - @Override public void afterHarvest(String appName) { // do nothing diff --git a/newrelic-agent/src/test/java/com/newrelic/agent/service/async/AsyncTransactionServiceTest.java b/newrelic-agent/src/test/java/com/newrelic/agent/service/async/AsyncTransactionServiceTest.java index 95141cd887..863a7f82df 100644 --- a/newrelic-agent/src/test/java/com/newrelic/agent/service/async/AsyncTransactionServiceTest.java +++ b/newrelic-agent/src/test/java/com/newrelic/agent/service/async/AsyncTransactionServiceTest.java @@ -58,12 +58,6 @@ public void testAsyncTransactionServiceTimeout() throws Exception { assertFalse(ServiceFactory.getAsyncTxService().putIfAbsent("mySecondKey", token)); assertEquals(2, ServiceFactory.getAsyncTxService().cacheSizeForTesting()); - // wait for the timeout - // respect whatever the timeout is, even though we tried to set it to 1 second above - // that value may have been set by a previous test (in GHA) and the 1 above will NOT overwrite - // this means it will likely take >3 mins in GHA, but at least it shouldn't fail on the first run every time -// long tokenTimeoutMillis = ServiceFactory.getAsyncTxService().getTimeoutMillisForTesting(); -// Thread.sleep(tokenTimeoutMillis + 5000); Thread.sleep( 5000); ServiceFactory.getAsyncTxService().cleanUpPendingTransactions();