Skip to content

Commit

Permalink
Skip a couple ServiceManager tests when running Java 8 on Windows.
Browse files Browse the repository at this point in the history
I've found them to be [flaky](#6731 (comment)). We already [skip](#2130) some tests under Windows, so what's two more (especially only under Java 8, which I didn't include when setting up [Windows CI](#2686) and which I was testing only as part of #6634)?

RELNOTES=n/a
PiperOrigin-RevId: 568645480
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Oct 2, 2023
1 parent 130709c commit 9005067
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.google.common.util.concurrent;

import static com.google.common.base.StandardSystemProperty.JAVA_SPECIFICATION_VERSION;
import static com.google.common.base.StandardSystemProperty.OS_NAME;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static java.util.Arrays.asList;
Expand Down Expand Up @@ -121,6 +123,10 @@ protected void doStop() {
}

public void testServiceStartupTimes() {
if (isWindows() && isJava8()) {
// Flaky there: https://github.com/google/guava/pull/6731#issuecomment-1736298607
return;
}
Service a = new NoOpDelayedService(150);
Service b = new NoOpDelayedService(353);
ServiceManager serviceManager = new ServiceManager(asList(a, b));
Expand Down Expand Up @@ -639,4 +645,12 @@ public void failure(Service service) {
failedServices.add(service);
}
}

private static boolean isWindows() {
return OS_NAME.value().startsWith("Windows");
}

private static boolean isJava8() {
return JAVA_SPECIFICATION_VERSION.value().equals("1.8");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.google.common.util.concurrent;

import static com.google.common.base.StandardSystemProperty.JAVA_SPECIFICATION_VERSION;
import static com.google.common.base.StandardSystemProperty.OS_NAME;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static java.util.Arrays.asList;
Expand Down Expand Up @@ -122,6 +124,10 @@ protected void doStop() {
}

public void testServiceStartupTimes() {
if (isWindows() && isJava8()) {
// Flaky there: https://github.com/google/guava/pull/6731#issuecomment-1736298607
return;
}
Service a = new NoOpDelayedService(150);
Service b = new NoOpDelayedService(353);
ServiceManager serviceManager = new ServiceManager(asList(a, b));
Expand All @@ -133,6 +139,10 @@ public void testServiceStartupTimes() {
}

public void testServiceStartupDurations() {
if (isWindows() && isJava8()) {
// Flaky there: https://github.com/google/guava/pull/6731#issuecomment-1736298607
return;
}
Service a = new NoOpDelayedService(150);
Service b = new NoOpDelayedService(353);
ServiceManager serviceManager = new ServiceManager(asList(a, b));
Expand Down Expand Up @@ -651,4 +661,12 @@ public void failure(Service service) {
failedServices.add(service);
}
}

private static boolean isWindows() {
return OS_NAME.value().startsWith("Windows");
}

private static boolean isJava8() {
return JAVA_SPECIFICATION_VERSION.value().equals("1.8");
}
}

0 comments on commit 9005067

Please sign in to comment.