chore(ci): add back optional static sleep for tests (#8258)

This commit is contained in:
Aseem Bansal 2023-06-19 13:47:44 +05:30 committed by GitHub
parent a5ee1cae62
commit 3de94c5223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,15 @@
import time
import os
import subprocess
_ELASTIC_BUFFER_WRITES_TIME_IN_SEC: int = 1
USE_STATIC_SLEEP: bool = bool(os.getenv("USE_STATIC_SLEEP", False))
ELASTICSEARCH_REFRESH_INTERVAL_SECONDS: int = int(os.getenv("ELASTICSEARCH_REFRESH_INTERVAL_SECONDS", 5))
def wait_for_writes_to_sync(max_timeout_in_sec: int = 120) -> None:
if USE_STATIC_SLEEP:
time.sleep(ELASTICSEARCH_REFRESH_INTERVAL_SECONDS)
return
start_time = time.time()
# get offsets
lag_zero = False