Skip to content

Commit 3092127

Browse files
committed
workunit/dencoder: fix corpus test for backword and forward compability
- changed the check for non-deterministic, return code 1 is also legit - unneeded check for is_dir, if it exist - limit the number of threads to prevent error Fixes: https://tracker.ceph.com/issues/67263 Signed-off-by: NitzanMordhai <[email protected]>
1 parent 02496a8 commit 3092127

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

qa/workunits/dencoder/test_readable.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def process_type(file_path, type):
6161
cmd_determ = [CEPH_DENCODER, "type", type, "is_deterministic"]
6262
determ_res = subprocess.run(cmd_determ, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
6363
# Check if the command failed
64-
if determ_res.returncode != 0:
64+
if determ_res.returncode != 0 and determ_res.returncode != 1:
6565
error_message = determ_res.stderr.decode().strip()
6666
debug_print(f"Error running command: {error_message}")
6767
return 1
@@ -222,7 +222,7 @@ def check_backward_compat():
222222
version_name = version.name
223223
_backward_compat[version_name] = {}
224224
type_dir = archive_dir / version_name / "forward_incompat"
225-
if type_dir.exists() and type_dir.is_dir():
225+
if type_dir.exists():
226226
for type_entry in type_dir.iterdir():
227227
if type_entry.is_dir():
228228
type_name = type_entry.name
@@ -243,7 +243,8 @@ def check_backward_compat():
243243

244244
def process_batch(batch):
245245
results = []
246-
with concurrent.futures.ThreadPoolExecutor() as executor:
246+
max_workers = 15
247+
with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
247248
futures = [
248249
executor.submit(
249250
test_object_wrapper, batch_type, vdir, arversion, current_ver
@@ -259,7 +260,8 @@ def process_batch(batch):
259260

260261
# Create a generator that processes batches asynchronously
261262
def async_process_batches(task_batches):
262-
with concurrent.futures.ProcessPoolExecutor() as executor:
263+
max_workers = 10
264+
with concurrent.futures.ProcessPoolExecutor(max_workers=max_workers) as executor:
263265
futures = [executor.submit(process_batch, batch) for batch in task_batches]
264266
for future in concurrent.futures.as_completed(futures):
265267
yield future.result()

0 commit comments

Comments
 (0)