Skip to content

Commit 54e9276

Browse files
cpovirkGoogle Java Core Libraries
authored and
Google Java Core Libraries
committed
Skip a couple ServiceManager tests when running Java 8 on Windows.
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: 570103461
1 parent 130709c commit 54e9276

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

android/guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java

+14
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package com.google.common.util.concurrent;
1818

19+
import static com.google.common.base.StandardSystemProperty.JAVA_SPECIFICATION_VERSION;
20+
import static com.google.common.base.StandardSystemProperty.OS_NAME;
1921
import static com.google.common.truth.Truth.assertThat;
2022
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
2123
import static java.util.Arrays.asList;
@@ -121,6 +123,10 @@ protected void doStop() {
121123
}
122124

123125
public void testServiceStartupTimes() {
126+
if (isWindows() && isJava8()) {
127+
// Flaky there: https://github.com/google/guava/pull/6731#issuecomment-1736298607
128+
return;
129+
}
124130
Service a = new NoOpDelayedService(150);
125131
Service b = new NoOpDelayedService(353);
126132
ServiceManager serviceManager = new ServiceManager(asList(a, b));
@@ -639,4 +645,12 @@ public void failure(Service service) {
639645
failedServices.add(service);
640646
}
641647
}
648+
649+
private static boolean isWindows() {
650+
return OS_NAME.value().startsWith("Windows");
651+
}
652+
653+
private static boolean isJava8() {
654+
return JAVA_SPECIFICATION_VERSION.value().equals("1.8");
655+
}
642656
}

guava-tests/test/com/google/common/util/concurrent/ServiceManagerTest.java

+18
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package com.google.common.util.concurrent;
1818

19+
import static com.google.common.base.StandardSystemProperty.JAVA_SPECIFICATION_VERSION;
20+
import static com.google.common.base.StandardSystemProperty.OS_NAME;
1921
import static com.google.common.truth.Truth.assertThat;
2022
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
2123
import static java.util.Arrays.asList;
@@ -122,6 +124,10 @@ protected void doStop() {
122124
}
123125

124126
public void testServiceStartupTimes() {
127+
if (isWindows() && isJava8()) {
128+
// Flaky there: https://github.com/google/guava/pull/6731#issuecomment-1736298607
129+
return;
130+
}
125131
Service a = new NoOpDelayedService(150);
126132
Service b = new NoOpDelayedService(353);
127133
ServiceManager serviceManager = new ServiceManager(asList(a, b));
@@ -133,6 +139,10 @@ public void testServiceStartupTimes() {
133139
}
134140

135141
public void testServiceStartupDurations() {
142+
if (isWindows() && isJava8()) {
143+
// Flaky there: https://github.com/google/guava/pull/6731#issuecomment-1736298607
144+
return;
145+
}
136146
Service a = new NoOpDelayedService(150);
137147
Service b = new NoOpDelayedService(353);
138148
ServiceManager serviceManager = new ServiceManager(asList(a, b));
@@ -651,4 +661,12 @@ public void failure(Service service) {
651661
failedServices.add(service);
652662
}
653663
}
664+
665+
private static boolean isWindows() {
666+
return OS_NAME.value().startsWith("Windows");
667+
}
668+
669+
private static boolean isJava8() {
670+
return JAVA_SPECIFICATION_VERSION.value().equals("1.8");
671+
}
654672
}

0 commit comments

Comments
 (0)