diff --git a/servicetalk-http-netty/src/test/java/io/servicetalk/http/netty/ClientEffectiveStrategyTest.java b/servicetalk-http-netty/src/test/java/io/servicetalk/http/netty/ClientEffectiveStrategyTest.java index 7e459f6f80..52a8ef4a53 100644 --- a/servicetalk-http-netty/src/test/java/io/servicetalk/http/netty/ClientEffectiveStrategyTest.java +++ b/servicetalk-http-netty/src/test/java/io/servicetalk/http/netty/ClientEffectiveStrategyTest.java @@ -65,10 +65,12 @@ import java.net.InetSocketAddress; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.EnumSet; import java.util.List; import java.util.Objects; import java.util.Queue; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.LinkedBlockingQueue; @@ -478,9 +480,10 @@ private static Buffer content(HttpExecutionContext ctx) { private static final class ClientInvokingThreadRecorder implements StreamingHttpClientFilterFactory { - private Thread applicationThread = Thread.currentThread(); - private HttpExecutionStrategy expectedStrategy; - private final EnumSet offloadPoints = EnumSet.noneOf(ClientOffloadPoint.class); + private volatile Thread applicationThread = Thread.currentThread(); + private volatile HttpExecutionStrategy expectedStrategy; + private final Set offloadPoints = + Collections.synchronizedSet(EnumSet.noneOf(ClientOffloadPoint.class)); private final ConcurrentMap invokingThreads = new ConcurrentHashMap<>(); private final Queue errors = new LinkedBlockingQueue<>();