comparison tests/OnClientTester.java @ 693:3442d331cad0

In test_ServerStopsReading, wait longer for the server to cancel the upload Some recent server versions perform more readahead in COPY INTO. This means that a query such as COPY 10 RECORDS INTO foo FROM 'some-file' ON CLIENT will upload much more data before the server finally decides it can cancel the rest of the upload. When testing the cancellation behavior we need to take this into account.
author Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
date Mon, 21 Nov 2022 15:59:49 +0100 (2022-11-21)
parents 61877c1f19f6
children aeb268156580
comparison
equal deleted inserted replaced
692:2233b172e06d 693:3442d331cad0
536 } 536 }
537 537
538 private void test_ServerStopsReading() throws SQLException, Failure { 538 private void test_ServerStopsReading() throws SQLException, Failure {
539 initTest("test_ServerStopsReading"); 539 initTest("test_ServerStopsReading");
540 prepare(); 540 prepare();
541 MyUploadHandler handler = new MyUploadHandler(100); 541 long n = 2 * 1024 * 1024 / 10;
542 MyUploadHandler handler = new MyUploadHandler(n);
542 conn.setUploadHandler(handler); 543 conn.setUploadHandler(handler);
543 update("COPY 10 RECORDS INTO foo FROM 'banana' ON CLIENT"); 544 update("COPY 10 RECORDS INTO foo FROM 'banana' ON CLIENT");
544 assertEq("cancellation callback called", true, handler.isCancelled()); 545 assertEq("cancellation callback called", true, handler.isCancelled());
545 assertEq("handler encountered write error", true, handler.encounteredWriteError()); 546 assertEq("handler encountered write error", true, handler.encounteredWriteError());
546 // connection is still alive 547 // connection is still alive