Skip to content

Commit dbc079a

Browse files
Optimize WEB_TESTS_URL download and extraction
- Add `web_tests_url` to `FuzzTaskInput` proto and recompile. - Sign `WEB_TESTS_URL` in `fuzz_task` preprocess. - In `utask_main`, if blackbox fuzzing, pass signed URL to `update_tests_if_needed`. - In `update_tests_if_needed`, handle signed URL (downloading to file if http). - Use `unzip -q` via `subprocess` for extraction if available for speed, falling back to `archive` module. - Refactor defensive checks in `fuzz_task`.
1 parent 4785d35 commit dbc079a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/clusterfuzz/_internal/bot/tasks/update_task.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import os
1818
import platform
1919
import shutil
20+
import subprocess
2021
import sys
2122
import time
2223

@@ -331,8 +332,10 @@ def update_tests_if_needed(tests_url=None):
331332
storage.copy_file_from(tests_url, temp_archive)
332333

333334
if shutil.which('unzip'):
334-
shell.execute_command(
335-
'unzip -q -o %s -d %s' % (temp_archive, data_directory))
335+
subprocess.run(
336+
['unzip', '-q', '-o', temp_archive, '-d', data_directory],
337+
check=True,
338+
capture_output=True)
336339
else:
337340
with archive.open(temp_archive) as reader:
338341
reader.extract_all(data_directory, trusted=True)

0 commit comments

Comments
 (0)