From 15f10b8cc0e16acd28dc28d387625a4769509b67 Mon Sep 17 00:00:00 2001 From: HÃ¥vard Pettersen Date: Wed, 2 Jun 2021 12:26:46 +0000 Subject: drop empty buffers support for Java --- jrt/tests/com/yahoo/jrt/LatencyTest.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'jrt/tests') diff --git a/jrt/tests/com/yahoo/jrt/LatencyTest.java b/jrt/tests/com/yahoo/jrt/LatencyTest.java index c8ead8ebf77..1c736fb28ea 100644 --- a/jrt/tests/com/yahoo/jrt/LatencyTest.java +++ b/jrt/tests/com/yahoo/jrt/LatencyTest.java @@ -17,12 +17,15 @@ public class LatencyTest { private final Supervisor server; private final Supervisor client; private final Acceptor acceptor; - public Network(CryptoEngine crypto, int threads) throws ListenFailedException { + public Network(CryptoEngine crypto, int threads, boolean dropEmpty) throws ListenFailedException { server = new Supervisor(new Transport("server", crypto, threads)); client = new Supervisor(new Transport("client", crypto, threads)); + server.setDropEmptyBuffers(dropEmpty); + client.setDropEmptyBuffers(dropEmpty); server.addMethod(new Method("inc", "i", "i", this::rpc_inc)); acceptor = server.listen(new Spec(0)); } + public Network(CryptoEngine crypto, int threads) throws ListenFailedException { this(crypto, threads, false); } public Target connect() { return client.connect(new Spec("localhost", acceptor.port())); } @@ -187,6 +190,13 @@ public class LatencyTest { } } + @org.junit.Test + public void testTlsCryptoWithDropEmptyBuffersLatency() throws Throwable { + try (Network network = new Network(new TlsCryptoEngine(createTestTlsContext()), 1, true)) { + new Client(false, network, 1).measureLatency("[tls crypto, drop empty, no reconnect] "); + } + } + @org.junit.Test public void testTransportThreadScaling() throws Throwable { try (Network network = new Network(new NullCryptoEngine(), 1)) { -- cgit v1.2.3