Skip to content
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

fix:命名管道读行为不符合posix规范问题 #1061

Merged
merged 10 commits into from
Nov 28, 2024

Conversation

xiaolin2004
Copy link
Collaborator

测试结果:
期望情况
非阻塞模式下

========== Testing Nonblocking Mode ==========

--- Testing: No readers (FIFO never had readers) (nonblocking=1) ---
Result: Failed to open FIFO for writing (ENXIO: No readers).

--- Testing: Reader exists but disconnects (nonblocking=1) ---
Result: Write failed with EPIPE (no readers available).

--- Testing: Active reader exists (nonblocking=1) ---
Result: Write succeeded. Bytes written: 13

阻塞模式下

========== Testing Blocking Mode ==========

--- Testing: No readers (FIFO never had readers) (nonblocking=0) ---
Result: Failed to open FIFO for writing (ENXIO: No readers).

--- Testing: Reader exists but disconnects (nonblocking=0) ---
Result: Write failed with EPIPE (no readers available).

--- Testing: Active reader exists (nonblocking=0) ---
Result: Write succeeded. Bytes written: 13

测试结果(截图)
image
image

@dragonosbot
Copy link

@xiaolin2004: no appropriate reviewer found, use r? to override

@dragonosbot dragonosbot added the S-等待审查 Status: 等待assignee以及相关方的审查。 label Nov 27, 2024
@github-actions github-actions bot added the Bug fix A bug is fixed in this pull request label Nov 27, 2024
@xiaolin2004 xiaolin2004 added the A-IPC Area: 进程间通信 label Nov 27, 2024
@fslongjin
Copy link
Member

测试程序应当添加类似assert的东西,表明结果是否符合预期。

@xiaolin2004
Copy link
Collaborator Author

测试程序应当添加类似assert的东西,表明结果是否符合预期。

assert可能会导致当测试失败时,命名管道无法被关闭,并且出现僵尸进程。

@fslongjin
Copy link
Member

测试程序应当添加类似assert的东西,表明结果是否符合预期。

assert可能会导致当测试失败时,命名管道无法被关闭,并且出现僵尸进程。

你搞个宏,用于在每个测试条件前面输出[PASSED],,[FAILED]这样的前缀就行。不然的话光看这个日志,我其实不知道什么样的输出才是合理的。

@Samuka007
Copy link
Member

fifo的测试重复了,可以写到原来的test_mkfifo测试里,或者删掉原来那个

Copy link
Member

@Samuka007 Samuka007 left a comment

Choose a reason for hiding this comment

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

  • 使测试程序更好表明结果是否符合预期
  • 考虑整合测试程序?

@xiaolin2004
Copy link
Collaborator Author

xiaolin2004 commented Nov 27, 2024

已经尽力写测试了。
真正导致不可读的是那些systemcall未实现的提示。
我认为两个测试不应该合并,test_mkfifo可以视为基本可用测试,而本测试仅对写规范进行测试,贸然合并只会让后人更加摸不着头脑。
本测试使用时间控制进程行为,非常初级,且不确定性强,建议测试者逐个运行测试而不是统一运行。

@xiaolin2004
Copy link
Collaborator Author

xiaolin2004 commented Nov 27, 2024

本pr的测试收到调度系统的影响极大,不稳定表现包括:睡眠1s的进程比睡眠5s的进程更晚醒来,甚至测试结束后才醒来。
#1062

@Samuka007 Samuka007 merged commit 3263fd4 into DragonOS-Community:master Nov 28, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-IPC Area: 进程间通信 Bug fix A bug is fixed in this pull request S-等待审查 Status: 等待assignee以及相关方的审查。
Projects
None yet
4 participants