From f8f845bfee198f0412a0b7fa4240b321f60655c9 Mon Sep 17 00:00:00 2001 From: thomasht86 Date: Tue, 1 Oct 2024 13:30:30 +0200 Subject: [PATCH 1/2] increase timeout from 300 to 600 --- tests/integration/test_integration_docker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integration/test_integration_docker.py b/tests/integration/test_integration_docker.py index efb24ff3..f840f4a1 100644 --- a/tests/integration/test_integration_docker.py +++ b/tests/integration/test_integration_docker.py @@ -2078,7 +2078,9 @@ def setUp(self) -> None: ) self.vespa_docker = VespaDocker(port=8089) - self.app = self.vespa_docker.deploy(application_package=self.app_package) + self.app = self.vespa_docker.deploy( + application_package=self.app_package, max_wait_deployment=600 + ) def test_crossencoder_threads(self): # Feed sample documents to the application From 4235ba08924a8899b69ede9208542d581411696d Mon Sep 17 00:00:00 2001 From: thomasht86 Date: Tue, 1 Oct 2024 13:58:08 +0200 Subject: [PATCH 2/2] use context manager for querying --- tests/integration/test_integration_docker.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/integration/test_integration_docker.py b/tests/integration/test_integration_docker.py index f840f4a1..d5b2c62d 100644 --- a/tests/integration/test_integration_docker.py +++ b/tests/integration/test_integration_docker.py @@ -2107,13 +2107,15 @@ def test_crossencoder_threads(self): } # Warm-up query - self.app.query(body=query_body) + with self.app.syncio() as sess: + _ = sess.query(body=query_body) query_body_reranking = { **query_body, "ranking.profile": "reranking", } # Query with default persearch threads (set to 4) - response_default = self.app.query(body=query_body_reranking) + with self.app.syncio() as sess: + response_default = sess.query(body=query_body_reranking) # Query with num-threads-per-search overridden to 1 query_body_one_thread = { @@ -2121,7 +2123,8 @@ def test_crossencoder_threads(self): "ranking.profile": "one-thread-profile", "ranking.matching.numThreadsPerSearch": 1, } - response_one_thread = self.app.query(body=query_body_one_thread) + with self.app.syncio() as sess: + response_one_thread = sess.query(body=query_body_one_thread) # Extract query times timing_default = response_default.json["timing"]