Page MenuHomeFreeBSD

Prevent running unix_passfd_test in parallel
ClosedPublic

Authored by olivier on May 19 2022, 7:15 PM.
Tags
None
Referenced Files
F105571975: D35260.diff
Tue, Dec 17, 7:38 PM
Unknown Object (File)
Thu, Dec 5, 7:47 PM
Unknown Object (File)
Thu, Nov 28, 6:45 AM
Unknown Object (File)
Nov 5 2024, 9:57 AM
Unknown Object (File)
Oct 26 2024, 7:30 AM
Unknown Object (File)
Oct 1 2024, 5:43 AM
Unknown Object (File)
Sep 30 2024, 12:40 AM
Unknown Object (File)
Sep 23 2024, 6:40 AM
Subscribers

Details

Summary

sys/kern/unix_passfd_test:send_and_* could not run at the same time.

Test Plan

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

olivier created this revision.

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?

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?

The all binary/scripts 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?

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.

This revision is now accepted and ready to land.May 22 2022, 6:15 AM