Skip to content

Commit

Permalink
Make AdjustStreamThreadCountTest#shouldResizeCacheAfterThreadReplacem…
Browse files Browse the repository at this point in the history
…ent not fragile
  • Loading branch information
dongjinleekr committed Apr 29, 2022
1 parent 137892e commit b7d7b91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,7 @@ public void close() {
waitForTransitionFromRebalancingToRunning();

logCaptureContext.await();
// after we replace the thread there should be two remaining threads with 5 bytes each for
// the cache and 50 for the input buffer
// all 10 bytes should be available for remaining thread
assertThat(logCaptureContext.getMessages(),
hasItems(containsString("Adding StreamThread-3, there are now 2 threads with cache size/max buffer size values as 5/50 per thread. ")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1130,8 +1130,7 @@ public void shouldNotThrowInvalidRangeExceptionWithNegativeFromKey() {
final Bytes keyFrom = Bytes.wrap(Serdes.Integer().serializer().serialize("", -1));
final Bytes keyTo = Bytes.wrap(Serdes.Integer().serializer().serialize("", 1));

try (final LogCaptureContext logCaptureContext = LogCaptureContext.create(this.getClass().getName()
+ "#shouldNotThrowInvalidRangeExceptionWithNegativeFromKey");
try (final LogCaptureContext logCaptureContext = LogCaptureContext.create();
final KeyValueIterator<Windowed<Bytes>, byte[]> iterator = cachingStore.fetch(keyFrom, keyTo, 0L, 10L)) {
assertFalse(iterator.hasNext());

Expand All @@ -1151,8 +1150,7 @@ public void shouldNotThrowInvalidBackwardRangeExceptionWithNegativeFromKey() {
final Bytes keyFrom = Bytes.wrap(Serdes.Integer().serializer().serialize("", -1));
final Bytes keyTo = Bytes.wrap(Serdes.Integer().serializer().serialize("", 1));

try (final LogCaptureContext logCaptureContext = LogCaptureContext.create(this.getClass().getName()
+ "#shouldNotThrowInvalidBackwardRangeExceptionWithNegativeFromKey");
try (final LogCaptureContext logCaptureContext = LogCaptureContext.create();
final KeyValueIterator<Windowed<Bytes>, byte[]> iterator =
cachingStore.backwardFetch(keyFrom, keyTo, Instant.ofEpochMilli(0L), Instant.ofEpochMilli(10L))) {
assertFalse(iterator.hasNext());
Expand Down

0 comments on commit b7d7b91

Please sign in to comment.