Skip to content

Commit

Permalink
Merge pull request #1060 from kuzudb/enable-multi-thread-testing
Browse files Browse the repository at this point in the history
enable multi-thread testing
  • Loading branch information
andyfengHKU committed Nov 23, 2022
2 parents acbbd4b + 6bddc51 commit 0ec32c0
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 27 deletions.
6 changes: 0 additions & 6 deletions src/processor/operator/include/result_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ class FTableSharedState {
}
unique_ptr<FTableScanMorsel> getMorsel(uint64_t maxMorselSize);

// A factorized table might be scanned multiple times.
inline void setToInitialState() {
lock_guard<mutex> lck{mtx};
nextTupleIdxToScan = 0u;
}

private:
mutex mtx;
shared_ptr<FactorizedTable> table;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ shared_ptr<ResultSet> FactorizedTableScan::init(ExecutionContext* context) {
resultSet->dataChunks[pos]->state = DataChunkState::getSingleValueDataChunkState();
}
initFurther(context);
sharedState->setToInitialState();
return resultSet;
}

Expand Down
2 changes: 1 addition & 1 deletion test/test_files/order_by/order_by.test
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

-NAME OrderByInt64Test
-QUERY MATCH (p:person) RETURN p.studentID ORDER BY p.studentID
-PARALLELISM 4
-PARALLELISM 2
-ENUMERATE
---- 3000
0
Expand Down
4 changes: 2 additions & 2 deletions test/test_files/read_list/2-bytes-per-edge.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions test/test_files/read_list/4-bytes-per-edge.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions test/test_files/tinySNB/agg/hash.test
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ 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
2|6|210

-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
2|18|4

-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
Expand Down
2 changes: 1 addition & 1 deletion test/test_files/tinySNB/agg/simple.test
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/test_files/tinySNB/order_by/order_by.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/test_files/tinySNB/union/union.test
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/test_utility/include/test_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> expectedTuples;
Expand Down

0 comments on commit 0ec32c0

Please sign in to comment.