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

Added QL's version endpoint rather than sleeping. #687 #775

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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
Loading