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;
|
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 static org.junit.Assert.fail;
|
||||||
|
|
||||||
import io.grpc.ManagedChannel;
|
import io.grpc.ManagedChannel;
|
||||||
|
|
@ -194,12 +194,12 @@ public class LoadWorkerTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clientObserver.onCompleted();
|
clientObserver.onCompleted();
|
||||||
assertTrue(stat.hasLatencies());
|
assertThat(stat.hasLatencies()).isTrue();
|
||||||
assertTrue(stat.getLatencies().getCount() < stat.getLatencies().getSum());
|
assertThat(stat.getLatencies().getCount()).isLessThan(stat.getLatencies().getSum());
|
||||||
double mean = stat.getLatencies().getSum() / stat.getLatencies().getCount();
|
double mean = stat.getLatencies().getSum() / stat.getLatencies().getCount();
|
||||||
System.out.println("Mean " + mean + " us");
|
System.out.println("Mean " + mean + " us");
|
||||||
assertTrue(mean > stat.getLatencies().getMinSeen());
|
assertThat(stat.getLatencies().getMinSeen()).isLessThan(mean);
|
||||||
assertTrue(mean < stat.getLatencies().getMaxSeen());
|
assertThat(stat.getLatencies().getMaxSeen()).isGreaterThan(mean);
|
||||||
}
|
}
|
||||||
|
|
||||||
private StreamObserver<Control.ClientArgs> startClient(Control.ClientArgs clientArgs)
|
private StreamObserver<Control.ClientArgs> startClient(Control.ClientArgs clientArgs)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue