diff --git a/src/test/java/net/openhft/chronicle/analytics/internal/GoogleAnalyticsTest.java b/src/test/java/net/openhft/chronicle/analytics/internal/GoogleAnalyticsTest.java index edbcb65..3cfc860 100644 --- a/src/test/java/net/openhft/chronicle/analytics/internal/GoogleAnalyticsTest.java +++ b/src/test/java/net/openhft/chronicle/analytics/internal/GoogleAnalyticsTest.java @@ -1,7 +1,7 @@ package net.openhft.chronicle.analytics.internal; import org.jetbrains.annotations.NotNull; -import org.junit.jupiter.api.Disabled; +import org.junit.Assume; import org.junit.jupiter.api.Test; import java.time.LocalTime; @@ -13,7 +13,7 @@ import static net.openhft.chronicle.analytics.internal.FilesUtil.removeLastUsedFileTimeStampSecond; import static org.junit.jupiter.api.Assertions.*; -@Disabled(/* failing test https://teamcity.chronicle.software/buildConfiguration/Chronicle_BuildAll_Build/677499?hideProblemsFromDependencies=false&hideTestsFromDependencies=false&expandBuildChangesSection=true&expandBuildTestsSection=true */) +//@Disabled(/* failing test https://teamcity.chronicle.software/buildConfiguration/Chronicle_BuildAll_Build/677499?hideProblemsFromDependencies=false&hideTestsFromDependencies=false&expandBuildChangesSection=true&expandBuildTestsSection=true */) final class GoogleAnalyticsTest { @Test @@ -80,15 +80,16 @@ void attemptToSendReset() { final int messages = 5; final TimeUnit timeUnit = TimeUnit.SECONDS; final long duration = 1; - removeLastUsedFileTimeStampSecond(); final GoogleAnalytics4 googleAnalytics = (GoogleAnalytics4) new VanillaAnalyticsBuilder("", "") .withFrequencyLimit(messages, duration, timeUnit) .withReportDespiteJUnit() .build(); - assertFalse(googleAnalytics.muted, "The instance is muted!"); - + /* This test would fail if run concurrently from two different JVMs, + therefore it's only run if the googleAnalytics instance is not muted (update in agreement with Rob) + */ + Assume.assumeFalse(googleAnalytics.muted); for (int i = 0; i < messages; i++) { assertTrue(googleAnalytics.attemptToSend(), "Round " + i); }