From b273f6d13a39ca72c5437b419f81e354ced32468 Mon Sep 17 00:00:00 2001 From: Olzhas Arystanov Date: Mon, 12 Jan 2026 18:10:53 +0500 Subject: [PATCH] Address flaky bucket name autocomplete integration test The test was failing occasionally when there were too many buckets at the time of sending the `b2://\t\t` sequence. The shell required a user action asking if it's fine to show all N possibilities. This change addresses the issue by prepending a bucket prefix to narrow the search results. --- .../+autocomplete-integration-flaky.infrastructure.md | 1 + test/integration/test_autocomplete.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog.d/+autocomplete-integration-flaky.infrastructure.md diff --git a/changelog.d/+autocomplete-integration-flaky.infrastructure.md b/changelog.d/+autocomplete-integration-flaky.infrastructure.md new file mode 100644 index 000000000..0441bcb53 --- /dev/null +++ b/changelog.d/+autocomplete-integration-flaky.infrastructure.md @@ -0,0 +1 @@ +Fix flaky autocomplete integration test. \ No newline at end of file diff --git a/test/integration/test_autocomplete.py b/test/integration/test_autocomplete.py index a48cfd936..8a9dcddb3 100644 --- a/test/integration/test_autocomplete.py +++ b/test/integration/test_autocomplete.py @@ -14,6 +14,7 @@ import pytest from test.helpers import patched_spawn, skip_on_windows +from test.integration.conftest import GENERAL_BUCKET_NAME_PREFIX TIMEOUT = 120 # CI can be slow at times when parallelization is extreme @@ -100,7 +101,11 @@ def test_autocomplete_b2__download_file__b2uri( pytest.skip('Not supported on Docker') shell.send(f'{cli_version} file download \t\t') shell.expect_exact('b2://', timeout=TIMEOUT) - shell.send('b2://\t\t') + + prefix_len = len(GENERAL_BUCKET_NAME_PREFIX) + 4 + prefix = bucket_name[:prefix_len] + shell.send(f'b2://{prefix}\t\t') shell.expect_exact(bucket_name, timeout=TIMEOUT) + shell.send(f'{bucket_name}/\t\t') shell.expect_exact(file_name, timeout=TIMEOUT)