Skip to content

Commit e881991

Browse files
committed
add log message to analyse not stable test
1 parent 3c51c57 commit e881991

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

operator-framework/src/test/java/com/github/containersolutions/operator/EventSchedulerTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import org.assertj.core.api.Condition;
1111
import org.junit.jupiter.api.Test;
1212
import org.mockito.invocation.InvocationOnMock;
13+
import org.slf4j.Logger;
14+
import org.slf4j.LoggerFactory;
1315

1416
import java.time.LocalDateTime;
1517
import java.util.ArrayList;
@@ -23,6 +25,8 @@
2325

2426
class EventSchedulerTest {
2527

28+
private static final Logger log = LoggerFactory.getLogger(EventSchedulerTest.class);
29+
2630
public static final int INVOCATION_DURATION = 80;
2731
public static final int MAX_RETRY_ATTEMPTS = 3;
2832
@SuppressWarnings("unchecked")
@@ -56,6 +60,7 @@ public void eventsAreNotExecutedConcurrentlyForSameResource() throws Interrupted
5660
eventScheduler.eventReceived(Watcher.Action.MODIFIED, resource2);
5761

5862
waitTimeForExecution(2);
63+
log.info("Event processing details 1.: {}. 2: {}", eventProcessingList.get(0), eventProcessingList.get(1));
5964
assertThat(eventProcessingList).hasSize(2)
6065
.matches(list -> eventProcessingList.get(0).getCustomResource().getMetadata().getResourceVersion().equals("1") &&
6166
eventProcessingList.get(1).getCustomResource().getMetadata().getResourceVersion().equals("2"),
@@ -242,5 +247,16 @@ public EventProcessingDetail setAction(Watcher.Action action) {
242247
public Exception getException() {
243248
return exception;
244249
}
250+
251+
@Override
252+
public String toString() {
253+
return "EventProcessingDetail{" +
254+
"action=" + action +
255+
", startTime=" + startTime +
256+
", endTime=" + endTime +
257+
", customResource=" + customResource +
258+
", exception=" + exception +
259+
'}';
260+
}
245261
}
246262
}

0 commit comments

Comments
 (0)