changeset 385:3ee02e94bd1d

Reduce number of queries to speed up testing
author Pedro Ferreira <pedro.ferreira@monetdbsolutions.com>
date Thu, 15 Oct 2020 11:56:07 +0200 (2020-10-15)
parents cc472ea19b3f
children 15b87fd68052
files tests/Bug_LargeQueries_6571_6693.java tests/Test_PSsomeamount.java tests/Test_Sbatching.java
diffstat 3 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/tests/Bug_LargeQueries_6571_6693.java
+++ b/tests/Bug_LargeQueries_6571_6693.java
@@ -14,7 +14,7 @@ import java.sql.SQLException;
 
 public class Bug_LargeQueries_6571_6693 {
 	final static String tbl_nm = "tbl6693";
-	final static String largedata = createLargedata(98765);
+	final static String largedata = createLargedata(9216);
 
 	private static String createLargedata(int num) {
 		String repeatValue = "*";
@@ -107,7 +107,7 @@ public class Bug_LargeQueries_6571_6693 
 		System.out.println("Completed second test");
 
 		// next try to make the execution hang by sending very many queries combined in 1 large script
-		final int queries = 8765;
+		final int queries = 100;
 		StringBuilder sb = new StringBuilder(queries * 13);
 		for (int i = 1; i <= queries; i++)
 			sb.append(" SELECT ").append(i).append(';');
--- a/tests/Test_PSsomeamount.java
+++ b/tests/Test_PSsomeamount.java
@@ -24,11 +24,11 @@ public class Test_PSsomeamount {
 
 		try {
 			System.out.println("1. Preparing and executing a unique statement");
-			for (int i = 0; i < 10000; i++) {
+			for (int i = 0; i < 100; i++) {
 				pstmt = con.prepareStatement("select " + i + ", " + i + " = ?");
 				pstmt.setInt(1, i);
 				ResultSet rs = pstmt.executeQuery();
-				if (rs.next() && i % 1000 == 0) {
+				if (rs.next() && i % 20 == 0) {
 					System.out.println(rs.getInt(1) + ", " + rs.getBoolean(2));
 				}
 				/* this call should cause resources on the server to be
--- a/tests/Test_Sbatching.java
+++ b/tests/Test_Sbatching.java
@@ -26,14 +26,14 @@ public class Test_Sbatching {
 			System.out.println("passed :)");
 
 			// start batching a large amount of inserts
-			for (int i = 1; i <= 30000; i++) {
+			for (int i = 1; i <= 150; i++) {
 				stmt.addBatch("INSERT INTO table_Test_Sbatching VALUES (" + i + ")");
-				if (i % 400 == 0) {
-					System.out.print("2. executing batch (400 inserts)...");
+				if (i % 50 == 0) {
+					System.out.print("2. executing batch (50 inserts)...");
 					int[] cnts = stmt.executeBatch();
 					System.out.println("passed :)");
 					System.out.print("3. checking number of update counts...");
-					if (cnts.length != 400)
+					if (cnts.length != 50)
 						throw new SQLException("Invalid size: " + cnts.length);
 					System.out.println(cnts.length + " passed :)");
 					System.out.print("4. checking update counts (should all be 1)...");