Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into featureX
Browse files Browse the repository at this point in the history
  • Loading branch information
yixinglu authored Jun 21, 2021
2 parents 932030b + 15bfb82 commit d3508a9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
24 changes: 13 additions & 11 deletions tests/job/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ def prepare(self):
resp = self.execute(query)
self.check_resp_succeeded(resp)

time.sleep(3)

resp = self.execute('SHOW HOSTS GRAPH')
self.check_resp_succeeded(resp)
assert not resp.is_empty()
Expand All @@ -43,8 +41,16 @@ def prepare(self):
self.addr_host2 = resp.row_values(1)[0].as_string()
self.addr_port2 = resp.row_values(1)[1].as_int()

resp = self.execute('UPDATE CONFIGS graph:session_reclaim_interval_secs = 1')
self.check_resp_succeeded(resp)
time.sleep(3)

@classmethod
def cleanup(self):
resp = self.execute('UPDATE CONFIGS graph:session_reclaim_interval_secs = 10')
self.check_resp_succeeded(resp)
time.sleep(3)

session = self.client_pool.get_session('root', 'nebula')
resp = session.execute('DROP USER session_user')
self.check_resp_succeeded(resp)
Expand Down Expand Up @@ -112,20 +118,16 @@ def test_sessions(self):
# 5: test expired session
resp = self.execute('UPDATE CONFIGS graph:session_idle_timeout_secs = 5')
self.check_resp_succeeded(resp)
resp = self.execute('UPDATE CONFIGS graph:session_reclaim_interval_secs = 1')
self.check_resp_succeeded(resp)
time.sleep(3)
resp = self.execute('SHOW SPACES;')
self.check_resp_succeeded(resp)
time.sleep(3)
resp = self.execute('SHOW SESSION {}'.format(session_id))
time.sleep(3)
# to wait for session expires
for i in range(3):
resp = self.execute('SHOW SPACES;')
self.check_resp_succeeded(resp)
time.sleep(3)
resp = self.execute('SHOW SESSION {}'.format(session_id))
self.check_resp_failed(resp, ttypes.ErrorCode.E_EXECUTION_ERROR)
resp = self.execute('UPDATE CONFIGS graph:session_idle_timeout_secs = 0')
self.check_resp_succeeded(resp)
resp = self.execute('UPDATE CONFIGS graph:session_reclaim_interval_secs = 10')
self.check_resp_succeeded(resp)
time.sleep(3)

def test_the_same_id_to_different_graphd(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/tck/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def is_finished(val) -> bool:


def wait_all_jobs_finished(sess, jobs=[]):
times = 30
times = 60
while jobs and times > 0:
jobs = [job for job in jobs if not is_job_finished(sess, job)]
time.sleep(0.5)
Expand Down
4 changes: 2 additions & 2 deletions tests/tck/features/insert/Insert.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Feature: Insert string vid of vertex and edge
INSERT VERTEX person VALUES "Tom":("Tom", 18);
"""
Then the execution should be successful
When executing query:
When try to execute query:
"""
INSERT VERTEX person(name, age), interest(name) VALUES "Tom":("Tom", 18, "basketball");
"""
Expand Down Expand Up @@ -292,7 +292,7 @@ Feature: Insert string vid of vertex and edge
| $$.student.number | $$.person.name |
| 20190901003 | 'Aero' |
# test same prop name diff type
When executing query:
When try to execute query:
"""
INSERT VERTEX person(name, age), employee(name) VALUES "Joy":("Joy", 18, 123), "Petter":("Petter", 19, 456);
INSERT EDGE schoolmate(likeness, nickname) VALUES "Joy"->"Petter":(90, "Petter");
Expand Down
1 change: 1 addition & 0 deletions tests/tck/features/schema/Schema.feature
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ Feature: Insert string vid of vertex and edge
Then the result should be, in any order:
| VertexID | t.name | t.age | t.description |
| "1" | "N/A" | -1 | "some one" |
And wait 3 seconds
# insert without default prop, failed
When executing query:
"""
Expand Down

0 comments on commit d3508a9

Please sign in to comment.