Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-118140: Make thetest_concurrent_futures.test_init quiet. #118141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

Eclips4
Copy link
Member

@Eclips4 Eclips4 commented Apr 22, 2024

Before this PR:

./python.exe -m test -q test_concurrent_futures -m test_init
Using random seed: 2943892526
0:00:00 load avg: 2.95 Run 8 tests sequentially
.
----------------------------------------------------------------------
Ran 1 test in 0.228s

OK
.
----------------------------------------------------------------------
Ran 1 test in 0.234s

OK
test_concurrent_futures.test_wait ran no tests

== Tests result: SUCCESS ==

7 tests run no tests:
    test_concurrent_futures.test_as_completed
    test_concurrent_futures.test_deadlock
    test_concurrent_futures.test_future
    test_concurrent_futures.test_process_pool
    test_concurrent_futures.test_shutdown
    test_concurrent_futures.test_thread_pool
    test_concurrent_futures.test_wait

Total duration: 1.8 sec
Total tests: run=10 (filtered)
Total test files: run=8/8 (filtered) run_no_tests=7
Result: SUCCESS

After:

./python.exe -m test -q test_concurrent_futures -m test_init               
Using random seed: 4087315254
0:00:00 load avg: 3.30 Run 8 tests sequentially
test_concurrent_futures.test_wait ran no tests

== Tests result: SUCCESS ==

7 tests run no tests:
    test_concurrent_futures.test_as_completed
    test_concurrent_futures.test_deadlock
    test_concurrent_futures.test_future
    test_concurrent_futures.test_process_pool
    test_concurrent_futures.test_shutdown
    test_concurrent_futures.test_thread_pool
    test_concurrent_futures.test_wait

Total duration: 1.8 sec
Total tests: run=10 (filtered)
Total test files: run=8/8 (filtered) run_no_tests=7
Result: SUCCESS

@encukou
Copy link
Member

encukou commented Apr 22, 2024

Did you consider only hiding the output in quiet mode?

@Eclips4
Copy link
Member Author

Eclips4 commented Apr 22, 2024

Did you consider only hiding the output in quiet mode?

No. I'm conside hiding input not only in quiet mode.
From time to time I'm running the full test suite and see something like this:

0:00:35 load avg: 13.99 [ 31/474] test.test_concurrent_futures.test_init passed (33.8 sec) -- running (14): test.test_asyncio.test_base_events (35.2 sec), test.test_concurrent_futures.test_process_pool (33.0 sec), test.test_asyncio.test_events (35.2 sec), test.test_asyncio.test_futures (35.2 sec), test.test_concurrent_futures.test_wait (32.6 sec), test.test_concurrent_futures.test_shutdown (32.6 sec), test.test_asyncio.test_sendfile (35.2 sec), test.test_asyncio.test_sock_lowlevel (35.2 sec), test.test_asyncio.test_ssl (35.2 sec), test.test_asyncio.test_subprocess (35.1 sec), test.test_asyncio.test_taskgroups (35.1 sec), test.test_asyncio.test_tasks (35.1 sec), test.test_concurrent_futures.test_as_completed (35.0 sec), test.test_concurrent_futures.test_deadlock (35.0 sec)
beginning 6 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)
123:456
.
----------------------------------------------------------------------
Ran 1 test in 0.557s

OK
.
----------------------------------------------------------------------
Ran 1 test in 0.740s

OK
...many other lines

This looks strange to me. It's not clear which test was passed and why it was printed.
FYI, all other instances of unittest.TextTestRunner in our test suite are being created with a stream argument.

Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

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

Right.
It would be nice to show all the buffers like this on failure, but that would be a larger change. This PR is an improvement.

@encukou encukou merged commit d687d3f into python:main Apr 23, 2024
@Eclips4 Eclips4 deleted the issue-118140 branch April 23, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants