Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix eternal_tests/eternal-load/bin/tests/test_load_fails: don't use 30 sec timeout when running eternal-load, use default suite timeout instead #2981

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
_REQUEST_SIZE = _REQUEST_BLOCK_COUNT * _BLOCKSIZE
_REQUEST_COUNT = (_FILE_SIZE * 1024 ** 3) / _REQUEST_SIZE
_BINARY_PATH = 'cloud/blockstore/tools/testing/eternal_tests/eternal-load/bin/eternal-load'
_TIMEOUT = 30


def __run_load_test(file_name):
def __run_load_test(file_name, timeout=None):
eternal_load = yatest_common.binary_path(_BINARY_PATH)

params = [
Expand All @@ -31,15 +30,15 @@ def __run_load_test(file_name):
'--write-rate', '70'
]

return run(params, stdout=PIPE, stderr=PIPE, universal_newlines=True, timeout=_TIMEOUT)
return run(params, stdout=PIPE, stderr=PIPE, universal_newlines=True, timeout=timeout)


def test_load_fails():
tmp_file = tempfile.NamedTemporaryFile(suffix=".test")

with ThreadPoolExecutor(max_workers=1) as executor:
future = executor.submit(__run_load_test, tmp_file.name)
time.sleep(_TIMEOUT / 2)
time.sleep(10)

cnt = 0
while future.running():
Expand All @@ -54,10 +53,11 @@ def test_load_fails():


def test_load_works():
timeout = 30
tmp_file = tempfile.NamedTemporaryFile(suffix=".test")
try:
assert __run_load_test(tmp_file.name).returncode == 0
assert __run_load_test(tmp_file.name, timeout).returncode == 0
except TimeoutExpired:
pass
else:
pytest.fail(f"Eternal load should not have finished in {_TIMEOUT} seconds")
pytest.fail(f"Eternal load should not have finished within {timeout} seconds")
Loading