##// END OF EJS Templates
run-tests: wait for test threads after first error...
Gregory Szorc -
r24507:a0668a58 default
parent child Browse files
Show More
@@ -1390,16 +1390,19 b' class TestSuite(unittest.TestSuite):'
1390 done.put(('!', test, 'run-test raised an error, see traceback'))
1390 done.put(('!', test, 'run-test raised an error, see traceback'))
1391 raise
1391 raise
1392
1392
1393 stoppedearly = False
1394
1393 try:
1395 try:
1394 while tests or running:
1396 while tests or running:
1395 if not done.empty() or running == self._jobs or not tests:
1397 if not done.empty() or running == self._jobs or not tests:
1396 try:
1398 try:
1397 done.get(True, 1)
1399 done.get(True, 1)
1400 running -= 1
1398 if result and result.shouldStop:
1401 if result and result.shouldStop:
1402 stoppedearly = True
1399 break
1403 break
1400 except queue.Empty:
1404 except queue.Empty:
1401 continue
1405 continue
1402 running -= 1
1403 if tests and not running == self._jobs:
1406 if tests and not running == self._jobs:
1404 test = tests.pop(0)
1407 test = tests.pop(0)
1405 if self._loop:
1408 if self._loop:
@@ -1413,6 +1416,18 b' class TestSuite(unittest.TestSuite):'
1413 args=(test, result))
1416 args=(test, result))
1414 t.start()
1417 t.start()
1415 running += 1
1418 running += 1
1419
1420 # If we stop early we still need to wait on started tests to
1421 # finish. Otherwise, there is a race between the test completing
1422 # and the test's cleanup code running. This could result in the
1423 # test reporting incorrect.
1424 if stoppedearly:
1425 while running:
1426 try:
1427 done.get(True, 1)
1428 running -= 1
1429 except queue.Empty:
1430 continue
1416 except KeyboardInterrupt:
1431 except KeyboardInterrupt:
1417 for test in runtests:
1432 for test in runtests:
1418 test.abort()
1433 test.abort()
@@ -265,7 +265,8 b' failures in parallel with --first should'
265 this test is still more bytes than success.
265 this test is still more bytes than success.
266
266
267 Failed test-failure*.t: output changed (glob)
267 Failed test-failure*.t: output changed (glob)
268 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
268 Failed test-nothing.t: output changed
269 # Ran 2 tests, 0 skipped, 0 warned, 2 failed.
269 python hash seed: * (glob)
270 python hash seed: * (glob)
270 [1]
271 [1]
271
272
General Comments 0
You need to be logged in to leave comments. Login now