redballoonsecurity / ofrak

OFRAK: unpack, modify, and repack binaries.
https://ofrak.com
Other
1.82k stars 128 forks source link

Fix an issue with parallel tests potentially clashing #468

Closed ANogin closed 1 month ago

ANogin commented 1 month ago

One sentence summary of this PR (This should go in the CHANGELOG!) Fix an issue with parallel tests potentially clashing

Link to Related Issue(s) N/A

Please describe the changes in your request. The test_function_replacement_modifier in ofrak/ofrak_core/test_ofrak/components/test_patch_maker_component.py is configured to run several times, sometimes writing the same replaced_hello.out program. When running tests in parallel, this can create spurious failures if two tests try to write the output binary at the same time. This change introduces an inter-process file lock to avoid this.

Anyone you think should look at this, specifically? Not sure