Skip to content

Commit

Permalink
Use thread safe list
Browse files Browse the repository at this point in the history
Fixes #23811
  • Loading branch information
stuartwdouglas committed Feb 21, 2022
1 parent 2e7e5c9 commit a4aac72
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Timeout;
Expand Down Expand Up @@ -49,7 +50,7 @@ void shouldAdd() {
.await().atMost(Duration.ofSeconds(5));
}

List<String> actual = new ArrayList<>();
List<String> actual = new CopyOnWriteArrayList<>();
Multi<TestOuterClass.Item> all = client.getAll(EMPTY)
.onFailure().invoke(th -> {
System.out.println("Failed to read");
Expand All @@ -65,8 +66,8 @@ void shouldAdd() {
@Timeout(TIMEOUT)
void shouldAddViaBidi() {
List<String> expected = new ArrayList<>();
List<String> echoed = new ArrayList<>();
List<String> actual = new ArrayList<>();
List<String> echoed = new CopyOnWriteArrayList<>();
List<String> actual = new CopyOnWriteArrayList<>();

Multi<TestOuterClass.Item> request = Multi.createFrom().emitter(
m -> {
Expand Down

0 comments on commit a4aac72

Please sign in to comment.