Skip to content

Commit 9807816

Browse files
authored
fix: Engine is running check (#204)
1 parent f778a5c commit 9807816

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/firebolt/async_db/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ async def is_engine_running(connection: Connection, engine_url: str) -> bool:
3232
"""
3333
# Url is not guaranteed to be of this structure,
3434
# but for the sake of error checking this is sufficient.
35-
engine_name = URL(engine_url).host.split(".")[0]
35+
engine_name = URL(engine_url).host.split(".")[0].replace("-", "_")
3636
resp = await _filter_request(
3737
connection,
3838
ENGINES_URL,
3939
{
4040
"filter.name_contains": engine_name,
41-
"filter.current_status_eq": "ENGINE_STATUS_RUNNING",
41+
"filter.current_status_eq": "ENGINE_STATUS_RUNNING_REVISION_SERVING",
4242
},
4343
)
4444
return len(resp.json()["edges"]) > 0

tests/unit/async_db/test_cursor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ def http_error(*args, **kwargs):
281281
httpx_mock.add_response(
282282
json={"edges": []},
283283
url=(
284-
get_engines_url + "?filter.name_contains=api"
285-
"&filter.current_status_eq=ENGINE_STATUS_RUNNING"
284+
get_engines_url + "?filter.name_contains=api_dev"
285+
"&filter.current_status_eq=ENGINE_STATUS_RUNNING_REVISION_SERVING"
286286
),
287287
)
288288
with raises(EngineNotRunningError) as excinfo:

tests/unit/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def password() -> str:
6464

6565
@fixture
6666
def server() -> str:
67-
return "api.mock.firebolt.io"
67+
return "api-dev.mock.firebolt.io"
6868

6969

7070
@fixture

0 commit comments

Comments
 (0)