Skip to content

bpo-30283: Backport regrtest features from master to 2.7#1516

Merged
vstinner merged 15 commits into
python:2.7from
vstinner:regrtest_backport_27
May 9, 2017
Merged

bpo-30283: Backport regrtest features from master to 2.7#1516
vstinner merged 15 commits into
python:2.7from
vstinner:regrtest_backport_27

Conversation

@vstinner

@vstinner vstinner commented May 9, 2017

Copy link
Copy Markdown
Member

This patch serie also takes in account @serhiy-storchaka review on my previous PR #1513.

@vstinner vstinner requested a review from serhiy-storchaka May 9, 2017 13:10
@vstinner

vstinner commented May 9, 2017

Copy link
Copy Markdown
Member Author

Example of output, parallel mode:

haypo@selma$ ./python -m test -j8 -rW 
== CPython 2.7.13+ (heads/regrtest_backport_27:d9324ab, May 9 2017, 15:09:11) [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)]
==   Linux-4.10.12-200.fc25.x86_64-x86_64-with-fedora-25-Twenty_Five little-endian
==   /home/haypo/prog/python/2.7/build/test_python_32262
Testing with flags: sys.flags(debug=0, py3k_warning=0, division_warning=0, division_new=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, tabcheck=0, verbose=0, unicode=0, bytes_warning=0, hash_randomization=0)
Using random seed 1313440
Run tests in parallel using 8 child processes
0:00:00 [  1/402] test_getargs passed
0:00:00 [  2/402] test_aepack skipped
test_aepack skipped -- No module named aetypes
0:00:00 [  3/402] test_pipes passed
0:00:00 [  4/402] test_stat passed
0:00:00 [  5/402] test_pkgimport passed
0:00:00 [  6/402] test_codeccallbacks passed
...
0:00:30 [119/402] test_syntax passed
0:00:30 [120/402] test_userstring passed -- running: test_io (30 sec)
0:00:30 [121/402] test_threading passed -- running: test_io (30 sec)
...
0:00:42 [180/402] test_isinstance passed -- running: test_io (43 sec)
0:00:42 [181/402] test_strop passed -- running: test_io (43 sec)
0:00:42 [182/402] test_zipfile64 skipped (resource denied) -- running: test_io (43 sec)
test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run
...
^C
...
Total duration: 53 sec
Tests result: INTERRUPTED

Another example of sequential run (test_sys modified to fail):

haypo@selma$ ./python -m test test_sys test_os
Run tests sequentially
0:00:00 [1/2] test_sys
test test_sys crashed -- <type 'exceptions.NameError'>: name 'x' is not defined
0:00:00 [2/2/1] test_os -- test_sys failed
[21657 refs]
[21657 refs]
1 test OK.
1 test failed:
    test_sys

Total duration: 193 ms
Tests result: FAILURE

Display running tests every 30 seconds if no test completed in the
meanwhile.
@vstinner

vstinner commented May 9, 2017

Copy link
Copy Markdown
Member Author

Ok, the patch serie is now ready for a review :-)

Sorry, I forgot two changes. Now it should be complete to be able to debug buildbot hang.

Comment thread Lib/test/regrtest.py
current_test = worker.current_test
if not current_test:
continue
dt = time.time() - worker.start_time

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible race condition. current_test can be the old test, but worker.start_time is the start time of the next test. This can be avoided if save (current_test, start_time) as a tuple.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. It's a deliberate choice to not use locks here, the output is just for debug purpose, I prefer simple code over correctness. Again, it's just a backport, if you want to enhance the code, it should be done first in the master branch ;-)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, nice catch ;-)

@vstinner vstinner merged commit 453a685 into python:2.7 May 9, 2017
@vstinner vstinner deleted the regrtest_backport_27 branch May 9, 2017 15:06
@vstinner

vstinner commented May 9, 2017

Copy link
Copy Markdown
Member Author

Merged, thanks for the review @serhiy-storchaka. I may fix regrtest in master later since you made multiple suggestions in this PR and the previous one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants