From 2aa4a82499d4becd2284cdb482213d541b8804dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 16:29:10 +0200 Subject: Adding upstream version 86.0.1. Signed-off-by: Daniel Baumann --- .../mozprocess/tests/scripts/infinite_loop.py | 20 ++++++++++++++++++++ .../mozprocess/tests/scripts/proccountfive.py | 4 ++++ .../mozprocess/tests/scripts/procnonewline.py | 6 ++++++ 3 files changed, 30 insertions(+) create mode 100644 testing/mozbase/mozprocess/tests/scripts/infinite_loop.py create mode 100644 testing/mozbase/mozprocess/tests/scripts/proccountfive.py create mode 100644 testing/mozbase/mozprocess/tests/scripts/procnonewline.py (limited to 'testing/mozbase/mozprocess/tests/scripts') diff --git a/testing/mozbase/mozprocess/tests/scripts/infinite_loop.py b/testing/mozbase/mozprocess/tests/scripts/infinite_loop.py new file mode 100644 index 0000000000..74c2b630a4 --- /dev/null +++ b/testing/mozbase/mozprocess/tests/scripts/infinite_loop.py @@ -0,0 +1,20 @@ +from __future__ import absolute_import + +import threading +import time +import sys +import signal + +if "deadlock" in sys.argv: + lock = threading.Lock() + + def trap(sig, frame): + lock.acquire() + + # get the lock once + lock.acquire() + # and take it again on SIGTERM signal: deadlock. + signal.signal(signal.SIGTERM, trap) + +while 1: + time.sleep(1) diff --git a/testing/mozbase/mozprocess/tests/scripts/proccountfive.py b/testing/mozbase/mozprocess/tests/scripts/proccountfive.py new file mode 100644 index 0000000000..c79faab6c2 --- /dev/null +++ b/testing/mozbase/mozprocess/tests/scripts/proccountfive.py @@ -0,0 +1,4 @@ +from __future__ import absolute_import, print_function + +for i in range(0, 5): + print(i) diff --git a/testing/mozbase/mozprocess/tests/scripts/procnonewline.py b/testing/mozbase/mozprocess/tests/scripts/procnonewline.py new file mode 100644 index 0000000000..170cc1b19d --- /dev/null +++ b/testing/mozbase/mozprocess/tests/scripts/procnonewline.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import, print_function + +import sys + +print("this is a newline") +sys.stdout.write("this has NO newline") -- cgit v1.2.3