fix(trino): add delay time to avoid Trino issue#735
fix(trino): add delay time to avoid Trino issue#735grieve54706 wants to merge 2 commits intotestcontainers:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #735 +/- ##
=======================================
Coverage ? 85.58%
=======================================
Files ? 12
Lines ? 666
Branches ? 104
=======================================
Hits ? 570
Misses ? 74
Partials ? 22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
what exception does it throw? can't that exception be added to wait_container_is_ready or one of the other decorator we have and it will catch that and rerun the waiter method? this module seems to be abusing the decorators a bit here.... |
|
The raised exception is when we use the Trino client to connect the container. We can't catch it. |
|
The trino logs in the container You can see the But the first query is deadline = time.time() + c.max_tries
while time.time() < deadline:
try:
cur = conn.cursor()
cur.execute("SELECT * FROM tpch.tiny.nation LIMIT 1")
cur.fetchall()
return
except Exception:
time.sleep(c.sleep_time)
raise TimeoutError(f"Trino did not start within {c.max_tries:.3f} seconds") |
|
Hi @alexanderankin, could you recheck this PR? |
I found the Trino container usually query failed due to
nodes is empty.I tried to execute
SELECT * FROM system.runtime.nodesandSHOW CATALOGS LIKE 'tpch'before querying to ensure that the node was active and the 'tpch' catalog was ready. It still encountered the problem. This issue may be related to a Trino discovery node problem. A similar issue was reported previously (see trinodb/trino#13388)The final solution is sleeping for a few seconds.