Skip to content

Commit 08feaa5

Browse files
author
Nathan Hawes
authored
Merge pull request #234 from nathawes/add-stress-tester-ci-script
Add run_sk_stress_test script to run the SourceKit stress tester over the source compatibility suite
2 parents a195d88 + 247f2ba commit 08feaa5

File tree

7 files changed

+1757
-59
lines changed

7 files changed

+1757
-59
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ swift-corelibs-foundation/
1414
swift-corelibs-libdispatch/
1515
swift-corelibs-xctest/
1616
swiftpm/
17+
swift-stress-tester/

cleanup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def main():
5252
'swift-corelibs-foundation',
5353
'swift-corelibs-libdispatch',
5454
'swift-corelibs-xctest',
55+
'swift-stress-tester'
5556
]
5657

5758
if args.cleanup_cache:

common.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ def set_swift_branch(branch):
143143
swift_branch = branch
144144

145145

146+
def set_default_execute_timeout(timeout):
147+
"""Override the default execute timeout"""
148+
global DEFAULT_EXECUTE_TIMEOUT
149+
DEFAULT_EXECUTE_TIMEOUT = timeout
150+
151+
146152
def clone_repos():
147153
"""Clone Swift and dependencies in parallel.
148154
@@ -299,14 +305,16 @@ def __str__(self):
299305
self.returncode))
300306

301307

302-
def execute(command, timeout=DEFAULT_EXECUTE_TIMEOUT,
308+
def execute(command, timeout=None,
303309
stdout=sys.stdout, stderr=sys.stderr,
304310
**kwargs):
305311
"""Execute a given command with an optional timeout in seconds.
306312
307313
>>> execute(['echo', 'Hello, World!'])
308314
0
309315
"""
316+
if timeout is None:
317+
timeout = DEFAULT_EXECUTE_TIMEOUT
310318
shell_debug_print(command, stderr=stderr)
311319
returncode = 124 # timeout return code
312320
try:
@@ -320,13 +328,15 @@ def execute(command, timeout=DEFAULT_EXECUTE_TIMEOUT,
320328
return returncode
321329

322330

323-
def check_execute_output(command, timeout=DEFAULT_EXECUTE_TIMEOUT,
331+
def check_execute_output(command, timeout=None,
324332
stdout=sys.stdout, stderr=sys.stderr, **kwargs):
325333
"""Check execute a given command and return its output.
326334
327335
>>> check_execute_output(['echo', 'Hello, World!'])
328336
'Hello, World!\\n'
329337
"""
338+
if timeout is None:
339+
timeout = DEFAULT_EXECUTE_TIMEOUT
330340
shell_debug_print(command, stderr=stderr)
331341
try:
332342
with Timeout(timeout):
@@ -339,7 +349,7 @@ def check_execute_output(command, timeout=DEFAULT_EXECUTE_TIMEOUT,
339349
return output
340350

341351

342-
def check_execute(command, timeout=DEFAULT_EXECUTE_TIMEOUT,
352+
def check_execute(command, timeout=None,
343353
sandbox_profile=None, max_retries=1,
344354
stdout=sys.stdout, stderr=sys.stderr,
345355
**kwargs):
@@ -348,6 +358,8 @@ def check_execute(command, timeout=DEFAULT_EXECUTE_TIMEOUT,
348358
>>> check_execute(['echo', 'Hello, World!'])
349359
0
350360
"""
361+
if timeout is None:
362+
timeout = DEFAULT_EXECUTE_TIMEOUT
351363
if sandbox_profile:
352364
if platform.system() == 'Darwin':
353365
command = ['sandbox-exec', '-f', sandbox_profile] + command

0 commit comments

Comments
 (0)