Skip to content

Commit

Permalink
tune tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiee committed Feb 6, 2023
1 parent 33463d9 commit 92914c7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
- name: Test with pytest
run: |
docker-compose -f docker-compose.yaml up -d
sleep 45
sleep 20
pytest -s -v -k "not SSL"
working-directory: tests
- name: Test SSL connection with pytest
run: |
enable_ssl=true docker-compose -f docker-compose-ssl.yaml up -d
sleep 45
sleep 20
pytest -s -v -k "SSL"
working-directory: tests

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ jobs:
- name: Test with pytest
run: |
docker-compose -f docker-compose.yaml up -d
sleep 45
sleep 20
pytest -s -v -k "not SSL" --cov=../nebula3 --cov-report=xml --cov-append
working-directory: tests
- name: Test SSL connection with pytest
run: |
enable_ssl=true docker-compose -f docker-compose-ssl.yaml up -d
sleep 45
sleep 20
pytest -s -v -k "SSL" --cov=../nebula3 --cov-report=xml --cov-append
working-directory: tests
- name: Upload Coverage to Codecov
Expand Down
6 changes: 3 additions & 3 deletions tests/docker-compose-ssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ services:
- --cert_path=${cert_path}
- --key_path=${key_path}
- --enable_ssl=${enable_ssl}
- --session_reclaim_interval_secs=3
- --session_reclaim_interval_secs=2
depends_on:
- metad0
- metad1
Expand Down Expand Up @@ -324,7 +324,7 @@ services:
- --cert_path=${cert_path}
- --key_path=${key_path}
- --enable_ssl=${enable_ssl}
- --session_reclaim_interval_secs=3
- --session_reclaim_interval_secs=2
depends_on:
- metad0
- metad1
Expand Down Expand Up @@ -368,7 +368,7 @@ services:
- --cert_path=${cert_path}
- --key_path=${key_path}
- --enable_ssl=${enable_ssl}
- --session_reclaim_interval_secs=3
- --session_reclaim_interval_secs=2
depends_on:
- metad0
- metad1
Expand Down
6 changes: 3 additions & 3 deletions tests/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ services:
- --cert_path=${cert_path}
- --key_path=${key_path}
- --enable_ssl=${enable_ssl}
- --session_reclaim_interval_secs=3
- --session_reclaim_interval_secs=2
depends_on:
- metad0
- metad1
Expand Down Expand Up @@ -324,7 +324,7 @@ services:
- --cert_path=${cert_path}
- --key_path=${key_path}
- --enable_ssl=${enable_ssl}
- --session_reclaim_interval_secs=3
- --session_reclaim_interval_secs=2
depends_on:
- metad0
- metad1
Expand Down Expand Up @@ -368,7 +368,7 @@ services:
- --cert_path=${cert_path}
- --key_path=${key_path}
- --enable_ssl=${enable_ssl}
- --session_reclaim_interval_secs=3
- --session_reclaim_interval_secs=2
depends_on:
- metad0
- metad1
Expand Down
9 changes: 4 additions & 5 deletions tests/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ def get_local_session(pool):
def test_2_reconnect(self):
try:
session = self.pool.get_session('root', 'nebula')
# wait for the session update
time.sleep(2)

# wait for the session space info to be updated to meta service
session.execute(
'CREATE SPACE IF NOT EXISTS test_session(vid_type=FIXED_STRING(8)); USE test_session;'
)
Expand All @@ -55,9 +56,7 @@ def test_2_reconnect(self):
if i == 3:
os.system('docker stop tests_graphd0_1')
os.system('docker stop tests_graphd1_1')
time.sleep(3)
# the session update later, the expect test
# resp = session.execute('SHOW TAGS')
time.sleep(1)
resp = session.execute('SHOW SESSIONS')
assert resp.is_succeeded(), resp.error_msg()
assert resp.space_name() == 'test_session'
Expand All @@ -70,7 +69,7 @@ def test_2_reconnect(self):
finally:
os.system('docker start tests_graphd0_1')
os.system('docker start tests_graphd1_1')
time.sleep(5)
time.sleep(2)

def test_3_session_context(self):
in_used_connects = self.pool.in_used_connects()
Expand Down

0 comments on commit 92914c7

Please sign in to comment.