Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ void setup(int streamCount) {
client = createClient(port.port(), splitEncodings);
}

@Setup(Level.Invocation)
@Setup(Level.Trial)
public void setup() {
setup(1);
}

@TearDown(Level.Invocation)
@TearDown(Level.Trial)
public void tearDown() {
try {
client.close();
Expand Down Expand Up @@ -181,12 +181,12 @@ void setup(int streamCount) {
client = createClient(port.port(), splitEncodings);
}

@Setup(Level.Invocation)
@Setup(Level.Trial)
public void setup() {
setup(streamCount);
}

@TearDown(Level.Invocation)
@TearDown(Level.Trial)
public void tearDown() {
try {
client.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import com.hedera.pbj.runtime.Codec;
import com.hedera.pbj.runtime.grpc.GrpcClient;
import com.hedera.pbj.runtime.grpc.Pipeline;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.SocketException;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Flow;
Expand Down Expand Up @@ -97,7 +97,7 @@ public static class BenchState {
PbjGrpcBench.ServerHandle server;
TestBlockStreamerInterface.TestBlockStreamerClient client;

@Setup(Level.Invocation)
@Setup(Level.Trial)
public void setup() {
final String[] splitEncodings = encodings.split(",");
final PbjGrpcServiceConfig serviceConfig =
Expand All @@ -108,7 +108,7 @@ public void setup() {
client = createClient(port.port(), splitEncodings);
}

@TearDown(Level.Invocation)
@TearDown(Level.Trial)
public void tearDown() {
try {
client.close();
Expand Down Expand Up @@ -166,9 +166,10 @@ public void onSubscribe(Flow.Subscription subscription) {
public void onError(Throwable throwable) {
latch.countDown();
if (throwable instanceof UncheckedIOException uioe
&& uioe.getCause() instanceof SocketException se
&& se.getMessage() != null
&& se.getMessage().contains("Socket closed")) {
&& uioe.getCause() instanceof IOException ioe
&& ioe.getMessage() != null
// We create this message in PbjGrpcCall. It's not localized. So the check is good:
&& ioe.getMessage().contains("sendPing failed")) {
// A streaming server may close its connection sometimes before
// the client has received and processed all the replies. However, the client's
// PbjGrpcCall may try and ping the server during the processing. This results in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ void setup(int streamCount) {
client = ClientHandle.createClient(port.port());
}

@Setup(Level.Invocation)
@Setup(Level.Trial)
public void setup() {
setup(1);
}

@TearDown(Level.Invocation)
@TearDown(Level.Trial)
public void tearDown() {
client.close();
client = null;
Expand Down Expand Up @@ -135,12 +135,12 @@ void setup(int streamCount) {
client = ClientHandle.createClient(port.port());
}

@Setup(Level.Invocation)
@Setup(Level.Trial)
public void setup() {
setup(streamCount);
}

@TearDown(Level.Invocation)
@TearDown(Level.Trial)
public void tearDown() {
client.close();
client = null;
Expand Down
Loading