Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Phaser;
import java.util.concurrent.TimeUnit;
import org.apache.commons.exec.OS;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.client.solrj.request.V2Request;
import org.apache.solr.client.solrj.request.beans.PluginMeta;
Expand Down Expand Up @@ -379,7 +380,13 @@ public void testListenerPlugins() throws Exception {
lastEvent.getType());
// verify timestamp
Instant now = Instant.now();
assertTrue("timestamp of the event is in the future", now.isAfter(lastEvent.getTimestamp()));
if (OS.isFamilyWindows()) {
// JDK-8180466 - Windows does not have fine-grained Instant support, so accept equal times
assertFalse(
"timestamp of the event is in the future", now.isBefore(lastEvent.getTimestamp()));
} else {
assertTrue("timestamp of the event is in the future", now.isAfter(lastEvent.getTimestamp()));
}
assertEquals(collection, ((CollectionsAddedEvent) lastEvent).getCollectionNames().next());

dummyEventLatch = new CountDownLatch(1);
Expand All @@ -398,7 +405,13 @@ public void testListenerPlugins() throws Exception {
lastEvent.getType());
// verify timestamp
now = Instant.now();
assertTrue("timestamp of the event is in the future", now.isAfter(lastEvent.getTimestamp()));
if (OS.isFamilyWindows()) {
// JDK-8180466 - Windows does not have fine-grained Instant support, so accept equal times
assertFalse(
"timestamp of the event is in the future", now.isBefore(lastEvent.getTimestamp()));
} else {
assertTrue("timestamp of the event is in the future", now.isAfter(lastEvent.getTimestamp()));
}
assertEquals(collection, ((CollectionsRemovedEvent) lastEvent).getCollectionNames().next());

// test changing the ClusterEventProducer plugin dynamically
Expand Down