Skip to content

Commit

Permalink
modify reconnect test (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
laura-ding authored Jun 21, 2021
1 parent e29254a commit 4c4118d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,15 @@ def get_local_session(pool):
def test_2_reconnect(self):
try:
session = self.pool.get_session('root', 'nebula')
session.execute('CREATE SPACE IF NOT EXISTS test_session; USE test_session;')
for i in range(0, 5):
if i == 3:
os.system('docker stop nebula-docker-compose_graphd0_1')
os.system('docker stop nebula-docker-compose_graphd1_1')
time.sleep(3)
resp = session.execute('SHOW SPACES')
if i >= 3:
assert resp.error_code() == ErrorCode.E_SESSION_INVALID
else:
assert resp.is_succeeded()
resp = session.execute('SHOW TAGS')
assert resp.is_succeeded()
assert resp.space_name() == 'test_session'
time.sleep(2)
session.release()
new_session = self.pool.get_session('root', 'nebula')
Expand Down

0 comments on commit 4c4118d

Please sign in to comment.