Page MenuHomeFreeBSD

Prevent running unix_passfd_test in parallel
ClosedPublic

Authored by olivier on May 19 2022, 7:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 8:16 PM
Unknown Object (File)
Feb 16 2024, 3:52 PM
Unknown Object (File)
Jan 28 2024, 2:41 AM
Unknown Object (File)
Dec 28 2023, 9:04 PM
Unknown Object (File)
Dec 28 2023, 7:05 PM
Unknown Object (File)
Dec 20 2023, 8:36 AM
Unknown Object (File)
Dec 19 2023, 4:42 PM
Unknown Object (File)
Dec 16 2023, 7:33 PM
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