Skip to content

[3.12] Make test_fcntl quiet (GH-108758) #108760

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
Sep 1, 2023

Conversation

miss-islington
Copy link
Contributor

Running test_fcntl logs two "struct.pack: ..." lines because
multiprocessing imports test_fcntl twice with
test.support.verbose=1. Move get_lockdata() inside TestFcntl test
case and only call it where it's needed, to stop logging these lines.
(cherry picked from commit 23f54c1)

Co-authored-by: Victor Stinner [email protected]

Running test_fcntl logs two "struct.pack: ..." lines because
multiprocessing imports test_fcntl twice with
test.support.verbose=1. Move get_lockdata() inside TestFcntl test
case and only call it where it's needed, to stop logging these lines.
(cherry picked from commit 23f54c1)

Co-authored-by: Victor Stinner <[email protected]>
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM, good bot.

@vstinner
Copy link
Member

vstinner commented Sep 1, 2023

Before:

$ ./python -m test test_fcntl
0:00:00 load avg: 0.97 Run tests sequentially
0:00:00 load avg: 0.97 [1/1] test_fcntl
struct.pack:  b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
struct.pack:  b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

== Tests result: SUCCESS ==

1 test OK.

Total duration: 954 ms
Tests result: SUCCESS

After:

$ ./python -m test test_fcntl
0:00:00 load avg: 1.05 Run tests sequentially
0:00:00 load avg: 1.05 [1/1] test_fcntl

== Tests result: SUCCESS ==

1 test OK.

Total duration: 778 ms
Tests result: SUCCESS

The two struct.pack: b'\x01\x00(...)' lines are gone.

@Yhg1s Yhg1s merged commit 4dc07d2 into python:3.12 Sep 1, 2023
@miss-islington miss-islington deleted the backport-23f54c1-3.12 branch September 1, 2023 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip issue skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants