Skip to content

Commit

Permalink
fix for 687
Browse files Browse the repository at this point in the history
  • Loading branch information
KeshavSoni2511 committed Sep 19, 2024
1 parent 163f69d commit 8fdc102
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Fix to return id and type in place of entityId and entityType (#751)
- Fixed failing test cases of test_geocoding.py (#755)
- Mentioned service path isn't the same as Orion's (#758)
- Added QL's version endpoint rather than sleeping (#687)

### Important: Backward compatibility

Expand Down
15 changes: 12 additions & 3 deletions src/wq/tests/benchmark/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from utils.tests.docker import dir_from_file_path, DockerCompose
from wq.tests.benchmark.factory import new_row_count_sampler, DbType, \
new_work_q_size_sampler
from conftest import QL_BASE_URL
from reporter.tests.utils import wait_until


MONITORING_DIR_NAME = '_monitoring'
Expand All @@ -15,6 +17,15 @@
DB_TABLE_FQN = 'public.etroom' # mt.etroom when using Crate?


def _can_get_ql_version() -> bool:
version_url = f"{QL_BASE_URL}/version"
response = requests.get(version_url)
return response.status_code == 200

def wait_for_ql():
wait_until(_can_get_ql_version)


class TestScript:

@staticmethod
Expand Down Expand Up @@ -48,9 +59,7 @@ def _prep_monitoring_dir(self):

def _start_docker_and_wait_for_services(self):
self._docker.start()
sleep(10)
# TODO call QL's version endpoint rather than sleeping.
# If it's up, then Redis & DB backend are up to b/c of docker deps.
wait_for_ql()

def _start_samplers(self):
self._db_sampler = new_row_count_sampler(self._mon_dir,
Expand Down

0 comments on commit 8fdc102

Please sign in to comment.