Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit d4741e1

Browse files
committed
fix fixture logic in pre-install
1 parent 965a755 commit d4741e1

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

tests/aws/services/es/test_es.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,13 @@ def run_install(*args):
5252

5353
@pytest.fixture(autouse=True)
5454
def elasticsearch():
55-
if is_aws_cloud() or test_config.TEST_SKIP_LOCALSTACK_START:
56-
# we don't install the dependencies if LocalStack is not running in process
57-
return
55+
# we only install the dependencies if LocalStack is running in the same process
56+
if not is_aws_cloud() and not test_config.TEST_SKIP_LOCALSTACK_START:
57+
if not installed.is_set():
58+
install_async()
5859

59-
if not installed.is_set():
60-
install_async()
60+
assert installed.wait(timeout=5 * 60), "gave up waiting for elasticsearch to install"
6161

62-
assert installed.wait(timeout=5 * 60), "gave up waiting for elasticsearch to install"
6362
yield
6463

6564

tests/aws/services/opensearch/test_opensearch.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,12 @@ def run_install(*args):
8282

8383
@pytest.fixture(autouse=True)
8484
def opensearch():
85-
if is_aws_cloud() or test_config.TEST_SKIP_LOCALSTACK_START:
86-
# we don't install the dependencies if LocalStack is not running in process
87-
return
88-
89-
if not installed.is_set():
90-
install_async()
85+
# we only install the dependencies if LocalStack is running in the same process
86+
if not is_aws_cloud() and not test_config.TEST_SKIP_LOCALSTACK_START:
87+
if not installed.is_set():
88+
install_async()
9189

92-
assert installed.wait(timeout=5 * 60), "gave up waiting for opensearch to install"
90+
assert installed.wait(timeout=5 * 60), "gave up waiting for opensearch to install"
9391
yield
9492

9593

tests/aws/services/transcribe/test_transcribe.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,24 +98,27 @@ def transcribe_snapshot_transformer(snapshot):
9898
class TestTranscribe:
9999
@pytest.fixture(scope="class", autouse=True)
100100
def pre_install_dependencies(self):
101-
if is_aws_cloud() or test_config.TEST_SKIP_LOCALSTACK_START:
102-
# we don't install the dependencies if LocalStack is not running in process
103-
return
104-
105-
if not ffmpeg_installed.is_set() or not vosk_installed.is_set():
106-
install_async()
101+
# we only install the dependencies if LocalStack is running in the same process
102+
if not is_aws_cloud() and not test_config.TEST_SKIP_LOCALSTACK_START:
103+
if not ffmpeg_installed.is_set() or not vosk_installed.is_set():
104+
install_async()
105+
106+
start = int(time.time())
107+
assert vosk_installed.wait(timeout=INSTALLATION_TIMEOUT), (
108+
"gave up waiting for Vosk to install"
109+
)
110+
elapsed = int(time.time() - start)
111+
assert ffmpeg_installed.wait(timeout=INSTALLATION_TIMEOUT - elapsed), (
112+
"gave up waiting for ffmpeg to install"
113+
)
114+
LOG.info(
115+
"Spent %s seconds downloading transcribe dependencies", int(time.time() - start)
116+
)
107117

108-
start = int(time.time())
109-
assert vosk_installed.wait(timeout=INSTALLATION_TIMEOUT), (
110-
"gave up waiting for Vosk to install"
111-
)
112-
elapsed = int(time.time() - start)
113-
assert ffmpeg_installed.wait(timeout=INSTALLATION_TIMEOUT - elapsed), (
114-
"gave up waiting for ffmpeg to install"
115-
)
116-
LOG.info("Spent %s seconds downloading transcribe dependencies", int(time.time() - start))
118+
assert not installation_errored.is_set(), (
119+
"installation of transcribe dependencies failed"
120+
)
117121

118-
assert not installation_errored.is_set(), "installation of transcribe dependencies failed"
119122
yield
120123

121124
@staticmethod

0 commit comments

Comments
 (0)