-
Notifications
You must be signed in to change notification settings - Fork 0
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
Test #1
base: gh-95672
Are you sure you want to change the base?
Test #1
Conversation
.format(data=data * page_size / (1024 ** 3))) | ||
sys.stdout.flush() | ||
time.sleep(1) | ||
if __name__ == "__main__": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lib/test/test_fcntl.py
에서 from test.memory_watchdog import page_size
이렇게 사용하기 위하여 이쪽을 main일경우만으로 변경하였는데 이런 변경이 괜찮은가요?
Lib/test/test_fcntl.py
Outdated
test_pipe_r, test_pipe_w = os.pipe() | ||
try: | ||
# Get the default pipesize with F_GETPIPE_SZ | ||
pipesize_default = fcntl.fcntl(test_pipe_w, fcntl.F_GETPIPE_SZ) | ||
print('start mhg') | ||
pipesize_default = fcntl.fcntl(test_pipe_w, 1032) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4096일 경우 Invalid argument
가 나오네요..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정상일경우 (1032)
[irteamsu@mhg-cpython-001-mgmd-jp2v-dev cpython]$ ./python -m test test_fcntl
0:00:00 load avg: 1.30 Run tests sequentially
0:00:00 load avg: 1.30 [1/1] test_fcntl
mhg7
mhg9
mhg10 ret: 0, errno: 0, async_err: 0, args: 3 1026 -2147483648
mhg12
4096
start mhg
mhg10 ret: 65536, errno: 0, async_err: 0, args: 4 1032 0
mhg12
end mhg
mhg7
mhg9
mhg10 ret: 32768, errno: 0, async_err: 0, args: 4 1031 32768
mhg12
mhg10 ret: 32768, errno: 0, async_err: 0, args: 4 1032 0
mhg12
mhg7
mhg9
mhg10 ret: 0, errno: 25, async_err: 0, args: 3 4 2048
mhg12
mhg2
mhg4
mhg6
mhg7
mhg9
mhg10 ret: 0, errno: 25, async_err: 0, args: 3 4 2048
mhg12
mhg2
mhg4
mhg6
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: 511 ms
Tests result: SUCCESS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
비정상일 경우 (4096)
[irteamsu@mhg-cpython-001-mgmd-jp2v-dev cpython]$ ./python -m test test_fcntl
0:00:00 load avg: 1.67 Run tests sequentially
0:00:00 load avg: 1.67 [1/1] test_fcntl
mhg7
mhg9
mhg10 ret: 0, errno: 0, async_err: 0, args: 3 1026 -2147483648
mhg12
4096
start mhg
mhg10 ret: -1, errno: 22, async_err: 0, args: 4 4096 0
mhg11
mhg7
mhg9
mhg10 ret: 0, errno: 25, async_err: 0, args: 3 4 2048
mhg12
mhg2
mhg4
mhg6
mhg7
mhg9
mhg10 ret: 0, errno: 25, async_err: 0, args: 3 4 2048
mhg12
mhg2
mhg4
mhg6
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'
test test_fcntl failed -- Traceback (most recent call last):
File "/home1/irteamsu/docs/cpython/Lib/test/test_fcntl.py", line 204, in test_fcntl_f_pipesize
pipesize_default = fcntl.fcntl(test_pipe_w, 4096)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument
test_fcntl failed (1 error)
== Tests result: FAILURE ==
1 test failed:
test_fcntl
Total duration: 545 ms
Tests result: FAILURE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
거기에 더하여 1029는 안되고, 1031은 되고 1033이상은 안되는 것 같네요
suc = [] | ||
for i in range(4097): | ||
try: | ||
pipesize_default = fcntl.fcntl(test_pipe_w, i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i가 page_size와 같은 4096이면 실패합니다.
[irteamsu@mhg-cpython-001-mgmd-jp2v-dev cpython]$ ./python -m test test_fcntl
0:00:00 load avg: 0.42 Run tests sequentially
0:00:00 load avg: 0.42 [1/1] test_fcntl
mhg7
mhg9
mhg10 ret: 0, errno: 0, async_err: 0, args: 3 1026 -2147483648
mhg12
4096
start mhg
mhg10 ret: -1, errno: 22, async_err: 0, args: 4 4096 0
mhg11
mhg7
mhg9
mhg10 ret: 0, errno: 25, async_err: 0, args: 3 4 2048
mhg12
mhg2
mhg4
mhg6
mhg7
mhg9
mhg10 ret: 0, errno: 25, async_err: 0, args: 3 4 2048
mhg12
mhg2
mhg4
mhg6
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'
test test_fcntl failed -- Traceback (most recent call last):
File "/home1/irteamsu/docs/cpython/Lib/test/test_fcntl.py", line 204, in test_fcntl_f_pipesize
pipesize_default = fcntl.fcntl(test_pipe_w, 4096)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument
test_fcntl failed (1 error)
== Tests result: FAILURE ==
1 test failed:
test_fcntl
Total duration: 534 ms
Tests result: FAILURE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
성공할경우의 로그입니다.
[irteamsu@mhg-cpython-001-mgmd-jp2v-dev cpython]$ ./python -m test test_fcntl
0:00:00 load avg: 0.46 Run tests sequentially
0:00:00 load avg: 0.46 [1/1] test_fcntl
mhg7
mhg9
mhg10 ret: 0, errno: 0, async_err: 0, args: 3 1026 -2147483648
mhg12
4096
start mhg
mhg10 ret: 65536, errno: 0, async_err: 0, args: 4 1032 0
mhg12
end mhg
mhg7
mhg9
mhg10 ret: 32768, errno: 0, async_err: 0, args: 4 1031 32768
mhg12
mhg10 ret: 32768, errno: 0, async_err: 0, args: 4 1032 0
mhg12
mhg7
mhg9
mhg10 ret: 0, errno: 25, async_err: 0, args: 3 4 2048
mhg12
mhg2
mhg4
mhg6
mhg7
mhg9
mhg10 ret: 0, errno: 25, async_err: 0, args: 3 4 2048
mhg12
mhg2
mhg4
mhg6
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: 515 ms
Tests result: SUCCESS
except: | ||
continue | ||
suc.append(i) | ||
print('end mhg', suc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suc에 담기는 값은 다음과 같습니다.
end mhg [0, 1, 2, 3, 4, 8, 9, 10, 11, 1025, 1026, 1030, 1031, 1032]
음 이번 이슈 같은 경우는
https://github.com/python/cpython/blob/6a5104f4fa83ed08fe31f712757dddabfede394c/Lib/test/test_fcntl.py#LL202C27-L202C30 |
python#95672 의 첫번째 이슈를 해결하기 위해 test하는 pr입니다..
fcntl
에서F_SETPIPE_SZ
에 대하여page size
보다 작은 값으로 pipe를 설정할 경우page size
로 업데이트한다.그렇기 때문에 test에서도 page_size로 확인해야한다.