comparison tests/OnClientTester.java @ 787:e349d8272a13

Revert "FailUploadLate tests: verify server didn't crash" It causes a test failure on the MonetDB release branch but the problem is in JDBC, not MonetDB itself. Needs to be reapplied and fixed before the next release of monetdb-java but can be reverted for now.
author Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
date Thu, 07 Dec 2023 09:01:37 +0100 (17 months ago)
parents 7e29d42e4267
children e890195256ac
comparison
equal deleted inserted replaced
786:f7df78989ac5 787:e349d8272a13
723 723
724 private void test_FailUploadLate() throws SQLException, Failure { 724 private void test_FailUploadLate() throws SQLException, Failure {
725 initTest("test_FailUploadLate"); 725 initTest("test_FailUploadLate");
726 prepare(); 726 prepare();
727 MyUploadHandler handler = new MyUploadHandler(100, 50, "i don't like line 50"); 727 MyUploadHandler handler = new MyUploadHandler(100, 50, "i don't like line 50");
728 handler.setChunkSize(99);
729 conn.setUploadHandler(handler); 728 conn.setUploadHandler(handler);
730 expectError("COPY INTO foo FROM 'banana' ON CLIENT", "i don't like"); 729 expectError("COPY INTO foo FROM 'banana' ON CLIENT", "i don't like");
731 assertEq("cancellation callback called", false, handler.isCancelled()); 730 assertEq("cancellation callback called", false, handler.isCancelled());
732 assertEq("connection is closed", true, conn.isClosed()); 731 assertEq("connection is closed", true, conn.isClosed());
733 try {
734 Thread.sleep(1000);
735 } catch (InterruptedException e) {
736
737 }
738 outBuffer.append("RECONNECT\n");
739 assertEq("reconnect succeeded", true, openConnection());
740 assertQueryInt("SELECT COUNT(*) FROM foo", 0);
741 exitTest(); 732 exitTest();
742 } 733 }
743 734
744 private void test_FailUploadLate2() throws SQLException, Failure { 735 private void test_FailUploadLate2() throws SQLException, Failure {
745 initTest("test_FailUploadLate2"); 736 initTest("test_FailUploadLate2");
759 }; 750 };
760 conn.setUploadHandler(handler); 751 conn.setUploadHandler(handler);
761 expectError("COPY INTO foo(t) FROM 'banana'(t) ON CLIENT", "after all"); 752 expectError("COPY INTO foo(t) FROM 'banana'(t) ON CLIENT", "after all");
762 assertEq("connection is closed", true, conn.isClosed()); 753 assertEq("connection is closed", true, conn.isClosed());
763 // Cannot check the server log, but at the time I checked, it said "prematurely stopped client", which is fine. 754 // Cannot check the server log, but at the time I checked, it said "prematurely stopped client", which is fine.
764 try {
765 Thread.sleep(1000);
766 } catch (InterruptedException e) {
767
768 }
769
770 outBuffer.append("RECONNECT\n");
771 assertEq("reconnect succeeded", true, openConnection());
772 assertQueryInt("SELECT COUNT(*) FROM foo", 0);
773
774 exitTest(); 755 exitTest();
775 } 756 }
776 757
777 private void test_FailDownloadLate() throws SQLException, Failure { 758 private void test_FailDownloadLate() throws SQLException, Failure {
778 initTest("test_FailDownloadLate"); 759 initTest("test_FailDownloadLate");