mirror of https://github.com/grpc/grpc-java.git
benchmarks: Use Truth in LoadWorkerTest
This will produce better error messages when the comparisons fail. This is to help debug aarch64 test failures.
This commit is contained in:
parent
80f1cbf6c4
commit
fe5511cf21
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package io.grpc.benchmarks.driver;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import io.grpc.ManagedChannel;
|
||||
|
|
@ -194,12 +194,12 @@ public class LoadWorkerTest {
|
|||
}
|
||||
}
|
||||
clientObserver.onCompleted();
|
||||
assertTrue(stat.hasLatencies());
|
||||
assertTrue(stat.getLatencies().getCount() < stat.getLatencies().getSum());
|
||||
assertThat(stat.hasLatencies()).isTrue();
|
||||
assertThat(stat.getLatencies().getCount()).isLessThan(stat.getLatencies().getSum());
|
||||
double mean = stat.getLatencies().getSum() / stat.getLatencies().getCount();
|
||||
System.out.println("Mean " + mean + " us");
|
||||
assertTrue(mean > stat.getLatencies().getMinSeen());
|
||||
assertTrue(mean < stat.getLatencies().getMaxSeen());
|
||||
assertThat(stat.getLatencies().getMinSeen()).isLessThan(mean);
|
||||
assertThat(stat.getLatencies().getMaxSeen()).isGreaterThan(mean);
|
||||
}
|
||||
|
||||
private StreamObserver<Control.ClientArgs> startClient(Control.ClientArgs clientArgs)
|
||||
|
|
|
|||
Loading…
Reference in New Issue