sys/kern/unix_passfd_test:send_and_* could not run at the same time.
Details
- Reviewers
glebius - Group Reviewers
tests - Commits
- rG2d896da92a2a: tests/unix_passfd: Prevent running them in parallel
Running in a loop, about 10 times minimum, will create this flaky behaviour:
# echo "parallelism=8" >> /etc/kyua/kyua.conf # cd /usr/tests/ # kyua test sys/kern/unix_passfd_test && echo yes sys/kern/unix_passfd_test:empty_rights_message -> passed [0.002s] sys/kern/unix_passfd_test:send_and_cancel -> passed [0.002s] sys/kern/unix_passfd_test:send_and_close -> passed [0.002s] sys/kern/unix_passfd_test:send_and_shutdown -> failed: /usr/src/tests/sys/kern/unix_passfd_test.c:368: openfiles() == nfiles - 1 not met [0.002s] sys/kern/unix_passfd_test:simple_send_fd -> passed [0.002s] sys/kern/unix_passfd_test:simple_send_fd_msg_cmsg_cloexec -> passed [0.001s] sys/kern/unix_passfd_test:truncated_rights -> passed [0.001s] sys/kern/unix_passfd_test:rights_creds_payload -> passed [0.006s] sys/kern/unix_passfd_test:two_files -> passed [0.001s] sys/kern/unix_passfd_test:devfs_orphan -> passed [0.008s] sys/kern/unix_passfd_test:copyout_rights_error -> passed [0.009s] sys/kern/unix_passfd_test:bundle_cancel -> passed [0.010s] sys/kern/unix_passfd_test:bundle -> passed [0.010s] Results file id is usr_tests.20220519-190658-169250 Results saved to /root/.kyua/store/results.usr_tests.20220519-190658-169250.db 12/13 passed (1 failed)
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Oh, this was somewhat predictable. The one that can't run in parallel is unix_passfd_test:send_and_shutdown. Is it possible to isolate only this one, or whole binary needs to be exclusive?
Is there a per-process counter that that test could check instead of a global one? It seems rather racy even if we aren't running tests in parallel?
No, it is impossible to do anything like that here. At the moment the file reference doesn't belong to neither process - neither to sender, nor to the receiver. It belongs to the in kernel socket. I failed to find any other way than the global counter. And it is rather important regression test. I don't want to remove it.
P.S. Would be nice feature for kyua/ATF to have some kind of a critical section for tests. We just need to isolate three non-blocking syscalls from other tests running.
Because this kyua limitation, the current trend is to disable parallel tests for the specific suite, and it is fine.