File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
test/stability-tests/src/it/java/software/amazon/awssdk/stability/tests/kinesis Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -183,8 +183,10 @@ private List<CompletableFuture<?>> generateSubscribeToShardFutures() {
183
183
.startingPosition (s -> s .type (ShardIteratorType .TRIM_HORIZON )),
184
184
responseHandler )
185
185
.thenAccept (b -> {
186
- // Only verify data if all events have been received.
187
- if (responseHandler .allEventsReceived ) {
186
+ // Only verify data if all events have been received and the received data is not empty.
187
+ // It is possible the received data is empty because there is no record at the position
188
+ // event with TRIM_HORIZON.
189
+ if (responseHandler .allEventsReceived && !responseHandler .receivedData .isEmpty ()) {
188
190
assertThat (producedData ).as (responseHandler .id + " has not received all events"
189
191
+ "." ).containsSequence (responseHandler .receivedData );
190
192
}
@@ -218,7 +220,7 @@ private static class TestSubscribeToShardResponseHandler extends TestEventStream
218
220
, SubscribeToShardEventStream > implements SubscribeToShardResponseHandler {
219
221
private final List <SdkBytes > receivedData = new ArrayList <>();
220
222
private final String id ;
221
- private boolean allEventsReceived = false ;
223
+ private volatile boolean allEventsReceived = false ;
222
224
223
225
TestSubscribeToShardResponseHandler (int consumerIndex , int shardIndex ) {
224
226
id = "consumer_" + consumerIndex + "_shard_" + shardIndex ;
You can’t perform that action at this time.
0 commit comments