Skip to content

Commit

Permalink
only create 1 part in tck (#4817)
Browse files Browse the repository at this point in the history
* only create 1 part in tck

* lower compile threads, keep same as ent version
  • Loading branch information
critical27 authored Nov 3, 2022
1 parent 609178e commit 63a63ac
Show file tree
Hide file tree
Showing 63 changed files with 140 additions and 135 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
-DENABLE_TESTING=on \
-GNinja \
-B build
echo "::set-output name=j::10"
echo "::set-output name=j::8"
;;
ubuntu2004)
# build with Debug type
Expand All @@ -109,7 +109,7 @@ jobs:
-DENABLE_COVERAGE=on \
-GNinja \
-B build
echo "::set-output name=j::10"
echo "::set-output name=j::8"
;;
esac
;;
Expand All @@ -123,7 +123,7 @@ jobs:
-DENABLE_TESTING=on \
-GNinja \
-B build
echo "::set-output name=j::6"
echo "::set-output name=j::4"
;;
esac
- name: Make
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:
-DENABLE_STANDALONE_VERSION=on \
-GNinja \
-B build
echo "::set-output name=j::10"
echo "::set-output name=j::8"
;;
esac
;;
Expand Down
10 changes: 5 additions & 5 deletions src/kvstore/test/NebulaStoreTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

DECLARE_uint32(raft_heartbeat_interval_secs);
DECLARE_bool(auto_remove_invalid_space);
DECLARE_bool(wal_sync);
const int32_t kDefaultVidLen = 8;
using nebula::meta::PartHosts;

Expand All @@ -38,11 +39,8 @@ void dump(const std::vector<T>& v) {
VLOG(1) << ss.str();
}

std::shared_ptr<apache::thrift::concurrency::PriorityThreadManager> getHandlers() {
auto handlersPool =
apache::thrift::concurrency::PriorityThreadManager::newPriorityThreadManager(1);
handlersPool->setNamePrefix("executor");
handlersPool->start();
std::shared_ptr<folly::IOThreadPoolExecutor> getHandlers() {
static auto handlersPool = std::make_shared<folly::IOThreadPoolExecutor>(1);
return handlersPool;
}

Expand Down Expand Up @@ -733,6 +731,7 @@ TEST(NebulaStoreTest, CheckpointTest) {
}

TEST(NebulaStoreTest, ThreeCopiesCheckpointTest) {
FLAGS_wal_sync = true;
fs::TempDir rootPath("/tmp/nebula_store_test.XXXXXX");
auto initNebulaStore = [](const std::vector<HostAddr>& peers,
int32_t index,
Expand Down Expand Up @@ -936,6 +935,7 @@ TEST(NebulaStoreTest, ThreeCopiesCheckpointTest) {
}
}
}
FLAGS_wal_sync = false;
}

TEST(NebulaStoreTest, ReadSnapshotTest) {
Expand Down
2 changes: 1 addition & 1 deletion src/kvstore/wal/FileBasedWal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ void FileBasedWal::scanLastWal(WalFileInfoPtr info, LogID firstId) {
}

if (id != curLogId) {
LOG(WARNING) << "LogId is not consistent" << id << " " << curLogId;
LOG(WARNING) << "LogId is not consistent " << id << " " << curLogId;
break;
}

Expand Down
8 changes: 4 additions & 4 deletions tests/admin/test_parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestParts(NebulaTestSuite):

@classmethod
def prepare(self):
resp = self.client.execute('CREATE SPACE space_show_parts(partition_num=5, vid_type=FIXED_STRING(8));'
resp = self.client.execute('CREATE SPACE space_show_parts(partition_num=1, vid_type=FIXED_STRING(8));'
'USE space_show_parts;')
self.check_resp_succeeded(resp)

Expand All @@ -41,17 +41,17 @@ def test_part(self):
leader_pattern,
peers_pattern,
losts_pattern]
for i in range(1, 6)
for i in range(1, 2)
]
self.check_result(resp, expected_result, is_regex=True)


# Specify the part id
resp = self.client.execute('SHOW PART 3')
resp = self.client.execute('SHOW PART 1')
self.check_resp_succeeded(resp)
expected_col_names = ["Partition ID", "Leader", "Peers", "Losts"]
self.check_column_names(resp, expected_col_names)
expected_result = [[re.compile(r'3'),
expected_result = [[re.compile(r'1'),
leader_pattern,
peers_pattern,
losts_pattern]]
Expand Down
26 changes: 13 additions & 13 deletions tests/admin/test_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_space(self):
self.check_resp_succeeded(resp)

# create space succeeded
resp = self.client.execute('CREATE SPACE default_space(partition_num=9, replica_factor=1, vid_type=FIXED_STRING(8))')
resp = self.client.execute('CREATE SPACE default_space(partition_num=1, replica_factor=1, vid_type=FIXED_STRING(8))')
self.check_resp_succeeded(resp)

# show spaces
Expand All @@ -52,7 +52,7 @@ def test_space(self):
resp = self.client.execute('SHOW CREATE SPACE default_space')
self.check_resp_succeeded(resp)

# create_space_str_result = 'CREATE SPACE `default_space` (partition_num = 9, '\
# create_space_str_result = 'CREATE SPACE `default_space` (partition_num = 1, '\
# 'replica_factor = 1, '\
# 'charset = utf8, '\
# 'collate = utf8_bin, '\
Expand All @@ -67,7 +67,7 @@ def test_space(self):
resp = self.client.execute('DROP SPACE default_space')
self.check_resp_succeeded(resp)

create_space_str = 'CREATE SPACE `default_space` (partition_num = 9, '\
create_space_str = 'CREATE SPACE `default_space` (partition_num = 1, '\
'replica_factor = 1, '\
'charset = utf8, '\
'collate = utf8_bin, '\
Expand All @@ -86,7 +86,7 @@ def test_space(self):
self.check_resp_succeeded(resp)

def test_charset_collate(self):
resp = self.client.execute('CREATE SPACE space_charset_collate (partition_num=9, '
resp = self.client.execute('CREATE SPACE space_charset_collate (partition_num=1, '
'replica_factor=1, charset=utf8, collate=utf8_bin, vid_type=FIXED_STRING(8))')
self.check_resp_succeeded(resp)

Expand All @@ -99,7 +99,7 @@ def test_charset_collate(self):
resp = self.client.execute('DROP SPACE space_charset_collate')
self.check_resp_succeeded(resp)

resp = self.client.execute('CREATE SPACE space_charset (partition_num=9, '
resp = self.client.execute('CREATE SPACE space_charset (partition_num=1, '
'replica_factor=1, charset=utf8, vid_type=FIXED_STRING(8))')
self.check_resp_succeeded(resp)

Expand All @@ -112,7 +112,7 @@ def test_charset_collate(self):
resp = self.client.execute('DROP SPACE space_charset')
self.check_resp_succeeded(resp)

resp = self.client.execute('CREATE SPACE space_collate (partition_num=9, '
resp = self.client.execute('CREATE SPACE space_collate (partition_num=1, '
'replica_factor=1, collate=utf8_bin, vid_type=FIXED_STRING(8))')
self.check_resp_succeeded(resp)

Expand All @@ -126,17 +126,17 @@ def test_charset_collate(self):
self.check_resp_succeeded(resp)

# not supported collate
resp = self.client.execute('CREATE SPACE space_charset_collate_nomatch (partition_num=9, '
resp = self.client.execute('CREATE SPACE space_charset_collate_nomatch (partition_num=1, '
'replica_factor=1, charset = utf8, collate=gbk_bin, vid_type=FIXED_STRING(8))')
self.check_resp_failed(resp)

# not supported charset
resp = self.client.execute('CREATE SPACE space_charset_collate_nomatch (partition_num=9, '
resp = self.client.execute('CREATE SPACE space_charset_collate_nomatch (partition_num=1, '
'replica_factor=1, charset = gbk, collate=utf8_bin, vid_type=FIXED_STRING(8))')
self.check_resp_failed(resp)

# not supported charset
resp = self.client.execute('CREATE SPACE space_illegal_charset (partition_num=9, '
resp = self.client.execute('CREATE SPACE space_illegal_charset (partition_num=1, '
'replica_factor=1, charset = gbk, vid_type=FIXED_STRING(8))')
self.check_resp_failed(resp)

Expand All @@ -145,11 +145,11 @@ def test_charset_collate(self):
'replica_factor=1, collate = gbk_bin, vid_type=FIXED_STRING(8))')
self.check_resp_failed(resp)

resp = self.client.execute('CREATE SPACE space_illegal_collate (partition_num=9, '
resp = self.client.execute('CREATE SPACE space_illegal_collate (partition_num=1, '
'replica_factor=1, collate = gbk_bin, vid_type=FIXED_STRING(8))')
self.check_resp_failed(resp)

resp = self.client.execute('CREATE SPACE space_capital (partition_num=9, '
resp = self.client.execute('CREATE SPACE space_capital (partition_num=1, '
'replica_factor=1, charset=UTF8, collate=UTF8_bin, vid_type=FIXED_STRING(8))')
self.check_resp_succeeded(resp)

Expand Down Expand Up @@ -201,7 +201,7 @@ def test_drop_space(self):
self.search_not_exist(resp, expect_result)

def test_create_space_with_string_vid(self):
resp = self.client.execute('CREATE SPACE space_string_vid (partition_num=9, '
resp = self.client.execute('CREATE SPACE space_string_vid (partition_num=1, '
'replica_factor=1, charset=utf8, collate=utf8_bin, '
'vid_type = fixed_string(30))')
self.check_resp_succeeded(resp)
Expand All @@ -216,7 +216,7 @@ def test_create_space_with_string_vid(self):
self.check_resp_succeeded(resp)

def test_create_space_with_int_vid(self):
resp = self.client.execute('CREATE SPACE space_int_vid (partition_num=9, '
resp = self.client.execute('CREATE SPACE space_int_vid (partition_num=1, '
'replica_factor=1, charset=utf8, collate=utf8_bin, '
'vid_type = int64)')
self.check_resp_succeeded(resp)
Expand Down
3 changes: 3 additions & 0 deletions tests/common/nebula_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ def _make_params(self, **kwargs):

# params for meta only
self.metad_param = copy.copy(_params)
self.metad_param["default_parts_num"] = 1

for p in [self.metad_param, self.storaged_param, self.graphd_param]:
p.update(kwargs)

Expand Down Expand Up @@ -338,6 +340,7 @@ def _make_sa_params(self, **kwargs):
self.graphd_param['add_local_host'] = 'false'
if self.query_concurrently:
self.graphd_param['max_job_size'] = '4'
self.graphd_param["default_parts_num"] = 1

for p in [self.metad_param, self.storaged_param, self.graphd_param]:
p.update(kwargs)
Expand Down
4 changes: 2 additions & 2 deletions tests/common/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class SpaceDesc:
def __init__(self,
name: str,
vid_type: str = "FIXED_STRING(32)",
partition_num: int = 7,
partition_num: int = 1,
replica_factor: int = 1,
charset: str = "utf8",
collate: str = "utf8_bin"):
Expand All @@ -26,7 +26,7 @@ def from_json(obj: dict):
return SpaceDesc(
name=obj.get('name', None),
vid_type=obj.get('vid_type', 'FIXED_STRING(32)'),
partition_num=obj.get('partition_num', 7),
partition_num=obj.get('partition_num', 1),
replica_factor=obj.get('replica_factor', 1),
charset=obj.get('charset', 'utf8'),
collate=obj.get('collate', 'utf8_bin'),
Expand Down
4 changes: 2 additions & 2 deletions tests/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def load_csv_data(
space_desc = SpaceDesc(
name=space_name,
vid_type=space.get('vidType', 'FIXED_STRING(32)'),
partition_num=space.get('partitionNum', 7),
partition_num=space.get('partitionNum', 1),
replica_factor=space.get('replicaFactor', 1),
charset=space.get('charset', 'utf8'),
collate=space.get('collate', 'utf8_bin'),
Expand All @@ -431,7 +431,7 @@ def load_csv_data(
resp_ok(sess, line.strip(), True)

# wait heartbeat_interval_secs + 1 seconds for schema synchronization
time.sleep(2)
time.sleep(3)

if config["files"] is not None:
for fd in config["files"]:
Expand Down
2 changes: 1 addition & 1 deletion tests/data/ldbc_v0_3_3/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
space:
name: ldbc_v0_3_3
partitionNum: 8
partitionNum: 1
replicaFactor: 1
vidType: FIXED_STRING(32)
charset: utf8
Expand Down
2 changes: 1 addition & 1 deletion tests/data/nba/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
space:
name: nba
partitionNum: 7
partitionNum: 1
replicaFactor: 1
vidType: FIXED_STRING(32)
charset: utf8
Expand Down
2 changes: 1 addition & 1 deletion tests/data/nba_int_vid/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
space:
name: nba_int_vid
partitionNum: 7
partitionNum: 1
replicaFactor: 1
vidType: int
charset: utf8
Expand Down
2 changes: 1 addition & 1 deletion tests/data/student/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
space:
name: student
partitionNum: 7
partitionNum: 1
replicaFactor: 1
vidType: FIXED_STRING(32)
charset: utf8
Expand Down
6 changes: 3 additions & 3 deletions tests/query/stateless/test_if_exists.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def test_drop_space(self):
resp = self.execute(cmd)
self.check_resp_succeeded(resp)

resp = self.execute('CREATE SPACE shakespaces(partition_num=1024, vid_type=FIXED_STRING(8))')
resp = self.execute('CREATE SPACE shakespaces(partition_num=1, vid_type=FIXED_STRING(8))')
self.check_resp_succeeded(resp)

resp = self.execute('CREATE SPACE IF NOT EXISTS shakespaces(partition_num=1024, vid_type=FIXED_STRING(8))')
resp = self.execute('CREATE SPACE IF NOT EXISTS shakespaces(partition_num=1, vid_type=FIXED_STRING(8))')
self.check_resp_succeeded(resp)

cmd = 'drop space shakespaces'
Expand All @@ -38,7 +38,7 @@ def test_drop_space(self):
resp = self.execute(cmd)
self.check_resp_succeeded(resp)

resp = self.execute('CREATE SPACE IF NOT EXISTS shakespaces(partition_num=1024, vid_type=FIXED_STRING(8))')
resp = self.execute('CREATE SPACE IF NOT EXISTS shakespaces(partition_num=1, vid_type=FIXED_STRING(8))')
self.check_resp_succeeded(resp)

time.sleep(self.delay)
Expand Down
6 changes: 3 additions & 3 deletions tests/query/stateless/test_keyword.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def prepare(self):
# some reversed keywords are moved to unreversed keywords, and vice versa in #1922
def test_keywords1(self):
resp = self.execute(
'CREATE SPACE IF NOT EXISTS test(partition_num=1024, vid_type=FIXED_STRING(8))')
'CREATE SPACE IF NOT EXISTS test(partition_num=1, vid_type=FIXED_STRING(8))')
self.check_resp_succeeded(resp)
time.sleep(self.delay)

Expand Down Expand Up @@ -301,7 +301,7 @@ def test_keywords1(self):

def test_keywords2(self):
resp = self.execute(
'CREATE SPACE IF NOT EXISTS test(partition_num=1024, vid_type=FIXED_STRING(8))')
'CREATE SPACE IF NOT EXISTS test(partition_num=1, vid_type=FIXED_STRING(8))')
self.check_resp_succeeded(resp)
time.sleep(self.delay)

Expand Down Expand Up @@ -901,7 +901,7 @@ def test_keywords2(self):

def test_keywords3(self):
resp = self.execute(
'CREATE SPACE IF NOT EXISTS test (partition_num=10, vid_type=FIXED_STRING(8))')
'CREATE SPACE IF NOT EXISTS test (partition_num=1, vid_type=FIXED_STRING(8))')
self.check_resp_succeeded(resp)
time.sleep(self.delay)

Expand Down
4 changes: 2 additions & 2 deletions tests/tck/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def new_space(request, options, exec_ctx):
name = "EmptyGraph_" + space_generator()
space_desc = SpaceDesc(
name=opts.get("name", name),
partition_num=int(opts.get("partition_num", 7)),
partition_num=int(opts.get("partition_num", 1)),
replica_factor=int(opts.get("replica_factor", 1)),
vid_type=opts.get("vid_type", "FIXED_STRING(30)"),
charset=opts.get("charset", "utf8"),
Expand All @@ -241,7 +241,7 @@ def new_space(request, exec_ctx):
name = "EmptyGraph_" + space_generator()
space_desc = SpaceDesc(
name=name,
partition_num=9,
partition_num=1,
replica_factor=1,
vid_type="FIXED_STRING(30)",
charset="utf8",
Expand Down
6 changes: 3 additions & 3 deletions tests/tck/features/admin/Hosts.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ Feature: Admin hosts
Then a SemanticError should be raised at runtime: space vid_type must be specified explicitly
When executing query:
"""
CREATE SPACE space_without_vid_type(partition_num=9, replica_factor=3);
CREATE SPACE space_without_vid_type(partition_num=1, replica_factor=3);
"""
Then a SemanticError should be raised at runtime: space vid_type must be specified explicitly
When executing query:
"""
CREATE SPACE space_without_vid_type(partition_num=9, replica_factor=3) on default_zone;
CREATE SPACE space_without_vid_type(partition_num=1, replica_factor=3) on default_zone;
"""
Then a SemanticError should be raised at runtime: Create space with zone is unsupported
When executing query:
Expand All @@ -56,7 +56,7 @@ Feature: Admin hosts
Then a SemanticError should be raised at runtime: Create space with zone is unsupported
When executing query:
"""
CREATE SPACE space_specify_vid_type(partition_num=9, replica_factor=1, vid_type=FIXED_STRING(8));
CREATE SPACE space_specify_vid_type(partition_num=1, replica_factor=1, vid_type=FIXED_STRING(8));
DROP SPACE space_specify_vid_type
"""
Then the execution should be successful
Loading

0 comments on commit 63a63ac

Please sign in to comment.