Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ply.yacc read parsetab.py error and lookup tests optimization #2855

Merged
merged 5 commits into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "webservice/Common.h"

DEFINE_uint32(expired_time_factor, 5, "The factor of expired time based on heart beat interval");
DEFINE_int32(heartbeat_interval_secs, 10, "Heartbeat interval");
DEFINE_int32(heartbeat_interval_secs, 10, "Heartbeat interval in seconds");
DEFINE_int32(meta_client_retry_times, 3, "meta client retry times, 0 means no retry");
DEFINE_int32(meta_client_retry_interval_secs, 1, "meta client sleep interval between retry");
DEFINE_int32(meta_client_timeout_ms, 60 * 1000, "meta client timeout");
Expand Down
3 changes: 1 addition & 2 deletions src/kvstore/NebulaStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,7 @@ void NebulaStore::removeSpaceDir(const std::string& dir) {
LOG(INFO) << "Try to remove space directory: " << dir;
boost::filesystem::remove_all(dir);
} catch (const boost::filesystem::filesystem_error& e) {
LOG(ERROR) << "Exception caught while remove directory, please delelte it "
"by manual: "
LOG(ERROR) << "Exception caught while remove directory, please delelte it by manual: "
<< e.what();
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def load_csv_data(
resp_ok(sess, line.strip(), True)

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

for fd in config["files"]:
_load_data_from_file(sess, data_dir, fd)
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ pytest-drop-dup-tests==0.3.0
pytest-bdd==4.0.2
pytest-yapf3==0.5.1
filelock==3.0.12
ply==3.11
ply==3.10
pyyaml==5.4
18 changes: 8 additions & 10 deletions tests/tck/features/lookup/ByIndex.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
Feature: Lookup by index itself

Background:
Given an empty graph
And load "nba" csv data to a new space

Scenario: [1] tag index
Given a graph with space named "nba"
When executing query:
"""
LOOKUP ON team
Expand Down Expand Up @@ -81,9 +78,9 @@ Feature: Lookup by index itself
| '76ers' | '76ers' |
| 'Trail Blazers' | 'Trail Blazers' |
| 'Bulls' | 'Bulls' |
And drop the used space

Scenario: [1] Tag TODO
Given a graph with space named "nba"
When executing query:
"""
LOOKUP ON team WHERE 1 + 1 == 2
Expand All @@ -104,9 +101,9 @@ Feature: Lookup by index itself
LOOKUP ON player WHERE player.age > -9223372036854775808-1
"""
Then a ExecutionError should be raised at runtime: result of (-9223372036854775808-1) cannot be represented as an integer
And drop the used space

Scenario: [2] edge index
Given a graph with space named "nba"
When executing query:
"""
LOOKUP ON serve
Expand Down Expand Up @@ -423,9 +420,9 @@ Feature: Lookup by index itself
| 'Dwight Howard' | 'Hawks' | 0 | 2016 |
| 'Dwight Howard' | 'Hornets' | 0 | 2017 |
| 'Dwight Howard' | 'Wizards' | 0 | 2018 |
And drop the used space

Scenario: [2] Edge TODO
Given a graph with space named "nba"
When executing query:
"""
LOOKUP ON serve WHERE 1 + 1 == 2
Expand All @@ -446,9 +443,9 @@ Feature: Lookup by index itself
LOOKUP ON serve WHERE serve.start_year == serve.end_year YIELD serve.start_year AS startYear
"""
Then a SemanticError should be raised at runtime:
And drop the used space

Scenario: [1] Compare INT and FLOAT during IndexScan
Given a graph with space named "nba"
When executing query:
"""
LOOKUP ON player WHERE player.age == 40 YIELD player.age AS Age
Expand Down Expand Up @@ -549,10 +546,11 @@ Feature: Lookup by index itself
| "Amar'e Stoudemire" | 36 | "Amar'e Stoudemire" |
| "Boris Diaw" | 36 | "Boris Diaw" |
| "Tony Parker" | 36 | "Tony Parker" |
And drop the used space

Scenario: [2] Compare INT and FLOAT during IndexScan
Given having executed:
Given an empty graph
And load "nba" csv data to a new space
And having executed:
"""
CREATE TAG weight (WEIGHT double);
CREATE TAG INDEX weight_index ON weight(WEIGHT);
Expand Down
18 changes: 8 additions & 10 deletions tests/tck/features/lookup/ByIndex.intVid.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
Feature: Lookup by index itself in integer vid

Background:
Given an empty graph
And load "nba_int_vid" csv data to a new space

Scenario: [1] tag index
Given a graph with space named "nba_int_vid"
When executing query:
"""
LOOKUP ON team
Expand Down Expand Up @@ -81,9 +78,9 @@ Feature: Lookup by index itself in integer vid
| '76ers' | '76ers' |
| 'Trail Blazers' | 'Trail Blazers' |
| 'Bulls' | 'Bulls' |
And drop the used space

Scenario: [1] Tag TODO
Given a graph with space named "nba_int_vid"
When executing query:
"""
LOOKUP ON team WHERE 1 + 1 == 2
Expand All @@ -104,9 +101,9 @@ Feature: Lookup by index itself in integer vid
LOOKUP ON player WHERE player.age > -9223372036854775808-1
"""
Then a ExecutionError should be raised at runtime: result of (-9223372036854775808-1) cannot be represented as an integer
And drop the used space

Scenario: [2] edge index
Given a graph with space named "nba_int_vid"
When executing query:
"""
LOOKUP ON serve
Expand Down Expand Up @@ -423,9 +420,9 @@ Feature: Lookup by index itself in integer vid
| 'Dwight Howard' | 'Hawks' | 0 | 2016 |
| 'Dwight Howard' | 'Hornets' | 0 | 2017 |
| 'Dwight Howard' | 'Wizards' | 0 | 2018 |
And drop the used space

Scenario: [2] Edge TODO
Given a graph with space named "nba_int_vid"
When executing query:
"""
LOOKUP ON serve WHERE 1 + 1 == 2
Expand All @@ -446,9 +443,9 @@ Feature: Lookup by index itself in integer vid
LOOKUP ON serve WHERE serve.start_year == serve.end_year YIELD serve.start_year AS startYear
"""
Then a SemanticError should be raised at runtime:
And drop the used space

Scenario: [1] Compare INT and FLOAT during IndexScan
Given a graph with space named "nba_int_vid"
When executing query:
"""
LOOKUP ON player WHERE player.age == 40 YIELD player.age AS Age
Expand Down Expand Up @@ -549,10 +546,11 @@ Feature: Lookup by index itself in integer vid
| "Amar'e Stoudemire" | 36 | "Amar'e Stoudemire" |
| "Boris Diaw" | 36 | "Boris Diaw" |
| "Tony Parker" | 36 | "Tony Parker" |
And drop the used space

Scenario: [2] Compare INT and FLOAT during IndexScan
Given having executed:
Given an empty graph
And load "nba_int_vid" csv data to a new space
And having executed:
"""
CREATE TAG weight (WEIGHT double);
CREATE TAG INDEX weight_index ON weight(WEIGHT);
Expand Down
3 changes: 1 addition & 2 deletions tests/tck/features/lookup/TagIndexFullScan.feature
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Feature: Lookup tag index full scan

Background:
Given an empty graph
And load "nba" csv data to a new space
Given a graph with space named "nba"

Scenario: Tag with relational RegExp filter[1]
When executing query:
Expand Down
4 changes: 2 additions & 2 deletions tests/tck/utils/nbv.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,11 +563,11 @@ def register_function(name, func):
register_function('hash', murmurhash2)


parser = yacc.yacc()
parser = yacc.yacc(write_tables=False)


def parse(s):
return parser.parse(s)
return parser.parse(s, lexer=lexer)


def parse_row(row):
Expand Down