You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2022/11/29 08:52:46 UTC

[flink] branch master updated: [FLINK-30228][test] Use thread-safe list

This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 3130b9a907a [FLINK-30228][test] Use thread-safe list
3130b9a907a is described below

commit 3130b9a907afb420f95a64a3cada19156fedc72a
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Mon Nov 28 14:44:02 2022 +0100

    [FLINK-30228][test] Use thread-safe list
---
 .../api/connector/source/lib/util/RateLimitedSourceReaderITCase.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/flink-tests/src/test/java/org/apache/flink/api/connector/source/lib/util/RateLimitedSourceReaderITCase.java b/flink-tests/src/test/java/org/apache/flink/api/connector/source/lib/util/RateLimitedSourceReaderITCase.java
index ed9df3f4a71..06602538103 100644
--- a/flink-tests/src/test/java/org/apache/flink/api/connector/source/lib/util/RateLimitedSourceReaderITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/api/connector/source/lib/util/RateLimitedSourceReaderITCase.java
@@ -34,6 +34,7 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
@@ -103,7 +104,8 @@ public class RateLimitedSourceReaderITCase extends TestLogger {
 
     private static class MockRateLimiterStrategy implements RateLimiterStrategy {
 
-        private static final List<MockRateLimiter> rateLimiters = new ArrayList<>();
+        private static final List<MockRateLimiter> rateLimiters =
+                Collections.synchronizedList(new ArrayList<>());
 
         @Override
         public RateLimiter createRateLimiter(int parallelism) {