-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '0717f36b22242f9b9da9ffdc2778455a0984eda8'
- Loading branch information
Showing
50 changed files
with
819 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
'''Profiling runner.''' | ||
|
||
import os | ||
import subprocess | ||
import time | ||
import atexit | ||
|
||
|
||
def main(): | ||
server_proc = subprocess.Popen([ | ||
'python3', '-m', 'huhhttp', '--port=8855', '--seed=4567', | ||
'--fuzz-period=999999' | ||
]) | ||
|
||
client_env = { | ||
'PYTHONPATH': os.path.join( | ||
os.path.abspath(os.path.dirname(__file__)), '..', '..' | ||
), | ||
'RUN_PROFILE': '1', | ||
} | ||
|
||
client_proc = subprocess.Popen( | ||
[ | ||
'python3', '-m', 'wpull', 'localhost:8855', '--waitretry=0', | ||
'--timeout=0.5', '-r', '--page-requisites', '-l=4', '--tries=1', | ||
'--delete-after', | ||
], | ||
env=client_env | ||
) | ||
|
||
def cleanup(): | ||
if server_proc.returncode is None: | ||
try: | ||
server_proc.terminate() | ||
except OSError: | ||
pass | ||
time.sleep(0.1) | ||
|
||
if client_proc.returncode is None: | ||
try: | ||
client_proc.terminate() | ||
except OSError: | ||
pass | ||
time.sleep(0.1) | ||
|
||
try: | ||
server_proc.kill() | ||
except OSError: | ||
pass | ||
try: | ||
client_proc.kill() | ||
except OSError: | ||
pass | ||
|
||
atexit.register(cleanup) | ||
|
||
client_proc.wait() | ||
cleanup() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.