From 6bddc51b87981d0e438fa54afe4aa9b87f99d20c Mon Sep 17 00:00:00 2001 From: xiyang Date: Wed, 23 Nov 2022 12:36:22 +0800 Subject: [PATCH] enable multi-thread testing --- src/processor/operator/include/result_collector.h | 6 ------ .../operator/table_scan/factorized_table_scan.cpp | 1 - test/test_files/order_by/order_by.test | 2 +- test/test_files/read_list/2-bytes-per-edge.test | 4 ++-- test/test_files/read_list/4-bytes-per-edge.test | 4 ++-- .../read_list/var_length_large_adj_list_extend.test | 2 +- test/test_files/tinySNB/agg/hash.test | 6 +++--- test/test_files/tinySNB/agg/simple.test | 2 +- test/test_files/tinySNB/order_by/order_by.test | 4 ++-- test/test_files/tinySNB/union/union.test | 2 +- .../var_length_extend/var_length_adj_list_extend.test | 4 ++-- .../var_length_extend/var_length_column_extend.test | 8 ++++---- test/test_utility/include/test_helper.h | 2 +- 13 files changed, 20 insertions(+), 27 deletions(-) diff --git a/src/processor/operator/include/result_collector.h b/src/processor/operator/include/result_collector.h index 527f612ca9..66e2e1681c 100644 --- a/src/processor/operator/include/result_collector.h +++ b/src/processor/operator/include/result_collector.h @@ -33,12 +33,6 @@ class FTableSharedState { } unique_ptr getMorsel(uint64_t maxMorselSize); - // A factorized table might be scanned multiple times. - inline void setToInitialState() { - lock_guard lck{mtx}; - nextTupleIdxToScan = 0u; - } - private: mutex mtx; shared_ptr table; diff --git a/src/processor/operator/table_scan/factorized_table_scan.cpp b/src/processor/operator/table_scan/factorized_table_scan.cpp index 0a6e20933f..2ce8e38d21 100644 --- a/src/processor/operator/table_scan/factorized_table_scan.cpp +++ b/src/processor/operator/table_scan/factorized_table_scan.cpp @@ -10,7 +10,6 @@ shared_ptr FactorizedTableScan::init(ExecutionContext* context) { resultSet->dataChunks[pos]->state = DataChunkState::getSingleValueDataChunkState(); } initFurther(context); - sharedState->setToInitialState(); return resultSet; } diff --git a/test/test_files/order_by/order_by.test b/test/test_files/order_by/order_by.test index 93299ea1cd..50fdcf8f37 100644 --- a/test/test_files/order_by/order_by.test +++ b/test/test_files/order_by/order_by.test @@ -40,7 +40,7 @@ -NAME OrderByInt64Test -QUERY MATCH (p:person) RETURN p.studentID ORDER BY p.studentID --PARALLELISM 4 +-PARALLELISM 2 -ENUMERATE ---- 3000 0 diff --git a/test/test_files/read_list/2-bytes-per-edge.test b/test/test_files/read_list/2-bytes-per-edge.test index 7492dfbf92..8207205545 100644 --- a/test/test_files/read_list/2-bytes-per-edge.test +++ b/test/test_files/read_list/2-bytes-per-edge.test @@ -25,14 +25,14 @@ -NAME CrossProduct1 -QUERY MATCH (a:person), (b:person) RETURN COUNT(*) --PARALLELISM 4 +-PARALLELISM 2 -ENUMERATE ---- 1 36000000 -NAME CrossProduct -QUERY MATCH (a:person) WITH AVG(a.ID) AS s MATCH (b:person) WHERE s > b.ID RETURN COUNT(*) --PARALLELISM 4 +-PARALLELISM 8 -ENUMERATE ---- 1 3000 diff --git a/test/test_files/read_list/4-bytes-per-edge.test b/test/test_files/read_list/4-bytes-per-edge.test index 71fad10bc0..cac450f9d7 100644 --- a/test/test_files/read_list/4-bytes-per-edge.test +++ b/test/test_files/read_list/4-bytes-per-edge.test @@ -31,14 +31,14 @@ -NAME IndexScanTest1 -QUERY MATCH (a:person) WHERE 381 = a.ID RETURN COUNT(*) --PARALLELISM 4 +-PARALLELISM 2 -ENUMERATE ---- 1 1 -NAME IndexScanTest2 -QUERY MATCH (a:person)-[:knows]->(b:person) WHERE 5000 = b.ID RETURN COUNT(*) --PARALLELISM 4 +-PARALLELISM 8 -ENUMERATE ---- 1 5001 diff --git a/test/test_files/read_list/var_length_large_adj_list_extend.test b/test/test_files/read_list/var_length_large_adj_list_extend.test index 317ea7a794..e92de5cfa6 100644 --- a/test/test_files/read_list/var_length_large_adj_list_extend.test +++ b/test/test_files/read_list/var_length_large_adj_list_extend.test @@ -16,6 +16,6 @@ # By the above formula, 28th, 29th, and 30th levels will contain 29*5K + 1, 30*5K + 1, and 31*5K+1 = 90*5K+3=450003. -NAME KnowsVeryLargeAdjListLongPathTest -QUERY MATCH (a:person)-[:knows*28..30]->(b:person) RETURN COUNT(*) --PARALLELISM 4 +-PARALLELISM 2 ---- 1 450003 diff --git a/test/test_files/tinySNB/agg/hash.test b/test/test_files/tinySNB/agg/hash.test index 887bd9596e..f1242e2051 100644 --- a/test/test_files/tinySNB/agg/hash.test +++ b/test/test_files/tinySNB/agg/hash.test @@ -41,7 +41,7 @@ Alice|1 -NAME OneHopHashAggTest -QUERY MATCH (a:person)-[:knows]->(b:person) RETURN a.gender, COUNT(*), SUM(b.age) ---PARALLELISM 4 +--PARALLELISM 3 -ENUMERATE ---- 2 1|8|245 @@ -49,7 +49,7 @@ Alice|1 -NAME TwoHopAggTest -QUERY MATCH (a:person)-[:knows]->(b:person)-[:knows]->(c:person) RETURN a.gender, COUNT(*), COUNT(DISTINCT b.age) ---PARALLELISM 4 +--PARALLELISM 5 -ENUMERATE ---- 2 1|18|4 @@ -57,7 +57,7 @@ Alice|1 -NAME OneHopAggFlatUnflatVecTest -QUERY MATCH (a:person)-[:knows]->(b:person) RETURN a.ID, b.gender, sum(b.age) --PARALLELISM 4 +-PARALLELISM 6 -ENUMERATE ---- 9 0|1|45 diff --git a/test/test_files/tinySNB/agg/simple.test b/test/test_files/tinySNB/agg/simple.test index 2646b02881..cbf872b4a6 100644 --- a/test/test_files/tinySNB/agg/simple.test +++ b/test/test_files/tinySNB/agg/simple.test @@ -1,6 +1,6 @@ -NAME OneHopSimpleAggTest -QUERY MATCH (a:person)-[:knows]->(b:person)-[:knows]->(c:person) RETURN COUNT(a.ID), MIN(a.fName), MAX(c.ID) ---PARALLELISM 4 +--PARALLELISM 8 -ENUMERATE ---- 1 36|Alice|5 diff --git a/test/test_files/tinySNB/order_by/order_by.test b/test/test_files/tinySNB/order_by/order_by.test index e17ca5c7e6..79cfd24673 100644 --- a/test/test_files/tinySNB/order_by/order_by.test +++ b/test/test_files/tinySNB/order_by/order_by.test @@ -92,7 +92,7 @@ Alice -NAME OrderByStrMultipleColTest -QUERY MATCH (p:person) RETURN p.age, p.eyeSight ORDER BY p.isWorker desc, p.age, p.eyeSight desc --PARALLELISM 4 +-PARALLELISM 2 ---- 8 20|4.800000 20|4.700000 @@ -106,7 +106,7 @@ Alice -NAME OrderByProjectionTest -QUERY MATCH (a:person)-[:knows]->(b:person) with b return b.fName order by b.fName desc -ENUMERATE --PARALLELISM 4 +-PARALLELISM 7 ---- 14 Greg Farooq diff --git a/test/test_files/tinySNB/union/union.test b/test/test_files/tinySNB/union/union.test index eb56016297..3f502f2584 100644 --- a/test/test_files/tinySNB/union/union.test +++ b/test/test_files/tinySNB/union/union.test @@ -1,6 +1,6 @@ -NAME UnionAllTwoQueriesTest -QUERY MATCH (p:person) RETURN p.age UNION ALL MATCH (p1:person) RETURN p1.age --PARALLELISM 4 +-PARALLELISM 8 ---- 16 20 20 diff --git a/test/test_files/tinySNB/var_length_extend/var_length_adj_list_extend.test b/test/test_files/tinySNB/var_length_extend/var_length_adj_list_extend.test index df95f15963..81df5012d1 100644 --- a/test/test_files/tinySNB/var_length_extend/var_length_adj_list_extend.test +++ b/test/test_files/tinySNB/var_length_extend/var_length_adj_list_extend.test @@ -20,13 +20,13 @@ -NAME KnowsKnows2To4HopTest -QUERY MATCH (a:person)-[:knows]->(b:person)-[:knows*2..4]->(c:person) RETURN COUNT(*) --PARALLELISM 4 +-PARALLELISM 2 ---- 1 1404 -NAME KnowsLongPathTest -QUERY MATCH (a:person)-[:knows*8..11]->(b:person) RETURN COUNT(*) --PARALLELISM 4 +-PARALLELISM 8 ---- 1 1049760 diff --git a/test/test_files/tinySNB/var_length_extend/var_length_column_extend.test b/test/test_files/tinySNB/var_length_extend/var_length_column_extend.test index d503c3ad4b..28ad7f9056 100644 --- a/test/test_files/tinySNB/var_length_extend/var_length_column_extend.test +++ b/test/test_files/tinySNB/var_length_extend/var_length_column_extend.test @@ -9,13 +9,13 @@ -NAME meetsOneToTwoHopTest -QUERY MATCH (a:person)-[:meets*1..2]->(b:person) RETURN COUNT(*) --PARALLELISM 3 +-PARALLELISM 2 ---- 1 13 -NAME meetsThreeHopMinLenEqualsMaxLen -QUERY MATCH (a:person)-[:meets*3..3]->(b:person) RETURN COUNT(*) --PARALLELISM 4 +-PARALLELISM 2 ---- 1 4 @@ -26,13 +26,13 @@ # 3), which generates another 4 paths (2 paths of length 2 and 2 paths of length 3). In total, there are 15 paths. -NAME varLenAdjListJoinWithVarLenColumnJoinTwoToFourHopTest -QUERY MATCH (a:person)-[:knows]->(b:person)-[:meets*2..3]->(c:person) RETURN COUNT(*) --PARALLELISM 4 +-PARALLELISM 8 ---- 1 13 -NAME meetsLongPathTest -QUERY MATCH (a:person)-[:meets*8..11]->(b:person) RETURN COUNT(*) --PARALLELISM 4 +-PARALLELISM 8 ---- 1 16 diff --git a/test/test_utility/include/test_helper.h b/test/test_utility/include/test_helper.h index 2864907f71..53cd00e1da 100644 --- a/test/test_utility/include/test_helper.h +++ b/test/test_utility/include/test_helper.h @@ -20,7 +20,7 @@ enum class TransactionTestType : uint8_t { struct TestQueryConfig { string name; string query; - uint64_t numThreads = 1; + uint64_t numThreads = 4; string encodedJoin; uint64_t expectedNumTuples = 0; vector expectedTuples;