Skip to content

Commit

Permalink
Merge pull request #14354 from stuartwdouglas/test-thread-safety
Browse files Browse the repository at this point in the history
Fix flakey RESTEasy reactive test
  • Loading branch information
geoand authored Jan 18, 2021
2 parents 07d887a + 97ecec8 commit fefa67c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.net.URI;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -133,8 +133,8 @@ public void testSse() throws InterruptedException {
WebTarget target = client.target(uri.toString() + "stream/sse");
try (SseEventSource sse = SseEventSource.target(target).build()) {
CountDownLatch latch = new CountDownLatch(1);
List<Throwable> errors = new ArrayList<>();
List<String> results = new ArrayList<>();
List<Throwable> errors = new CopyOnWriteArrayList<>();
List<String> results = new CopyOnWriteArrayList<>();
sse.register(event -> {
results.add(event.readData());
}, error -> {
Expand All @@ -155,8 +155,8 @@ public void testSseThrows() throws InterruptedException {
WebTarget target = client.target(uri.toString() + "stream/sse/throws");
try (SseEventSource sse = SseEventSource.target(target).build()) {
CountDownLatch latch = new CountDownLatch(1);
List<Throwable> errors = new ArrayList<>();
List<String> results = new ArrayList<>();
List<Throwable> errors = new CopyOnWriteArrayList<>();
List<String> results = new CopyOnWriteArrayList<>();
sse.register(event -> {
results.add(event.readData());
}, error -> {
Expand Down

0 comments on commit fefa67c

Please sign in to comment.