Skip to content

Commit

Permalink
SNOW-1356393: Fix flaky test EventHandlerTest.testEventFlusher (#1744)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dprzybysz authored Apr 30, 2024
1 parent 9e1c486 commit 72d9725
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/test/java/net/snowflake/client/core/EventHandlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,11 @@ public void testDumpLogBuffer() throws IOException {
@Test
public void testEventFlusher() {
EventHandler handler = new EventHandler(2, 1000);
handler.startFlusher();
assertEquals(0, handler.getBufferSize());
handler.triggerBasicEvent(Event.EventType.STATE_TRANSITION, "test event");
assertEquals(handler.getBufferSize(), 1);
assertEquals(1, handler.getBufferSize());
handler.triggerBasicEvent(Event.EventType.STATE_TRANSITION, "test event 2");
// buffer should flush when max entries is reached
assertEquals(handler.getBufferSize(), 0);
handler.stopFlusher();
assertEquals(0, handler.getBufferSize());
}
}

0 comments on commit 72d9725

Please sign in to comment.