Mercurial > hg > monetdb-java
changeset 783:7e29d42e4267
FailUploadLate tests: verify server didn't crash
author | Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com> |
---|---|
date | Fri, 30 Jun 2023 09:59:08 +0200 (22 months ago) |
parents | e234659cfd61 |
children | f261fe3c7fe4 |
files | tests/OnClientTester.java |
diffstat | 1 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/OnClientTester.java +++ b/tests/OnClientTester.java @@ -725,10 +725,19 @@ public final class OnClientTester { initTest("test_FailUploadLate"); prepare(); MyUploadHandler handler = new MyUploadHandler(100, 50, "i don't like line 50"); + handler.setChunkSize(99); conn.setUploadHandler(handler); expectError("COPY INTO foo FROM 'banana' ON CLIENT", "i don't like"); assertEq("cancellation callback called", false, handler.isCancelled()); assertEq("connection is closed", true, conn.isClosed()); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + + } + outBuffer.append("RECONNECT\n"); + assertEq("reconnect succeeded", true, openConnection()); + assertQueryInt("SELECT COUNT(*) FROM foo", 0); exitTest(); } @@ -752,6 +761,16 @@ public final class OnClientTester { expectError("COPY INTO foo(t) FROM 'banana'(t) ON CLIENT", "after all"); assertEq("connection is closed", true, conn.isClosed()); // Cannot check the server log, but at the time I checked, it said "prematurely stopped client", which is fine. + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + + } + + outBuffer.append("RECONNECT\n"); + assertEq("reconnect succeeded", true, openConnection()); + assertQueryInt("SELECT COUNT(*) FROM foo", 0); + exitTest(); }