Page MenuHomeFreeBSD

Add tests for aio(4) completion notification via signals
ClosedPublic

Authored by asomers on Jul 3 2017, 9:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 26, 6:24 PM
Unknown Object (File)
Sat, Jan 18, 5:15 PM
Unknown Object (File)
Sat, Jan 18, 5:10 PM
Unknown Object (File)
Dec 13 2024, 3:22 AM
Unknown Object (File)
Dec 1 2024, 11:09 PM
Unknown Object (File)
Nov 26 2024, 7:50 AM
Unknown Object (File)
Nov 14 2024, 11:23 PM
Unknown Object (File)
Nov 14 2024, 8:38 PM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Add tests for SIGEV_THREAD notification.

tests/sys/aio/aio_test.c
208 ↗(On Diff #30384)

Same style(9) fixes here that cem@ noted in the other review.

243 ↗(On Diff #30384)

Need (void) in the argument list for C.

  • Remove custom timeout code; rely on ATF's timeout mechanism instead
  • Use semaphores in signal tests instead of polling
  • Don't bother unlinking temporary files during cleanup; ATF will handle it. This means we can delete most tests' cleanup routines entirely.
  • style fixes suggested by jhb.

I'm a bit leery of the symlink thing for md cleanup, but presumably that permits cleanup if the external atf timeout kicks in? Also, it seems you've removed the explicit timeout in favor of the ATF one?

tests/sys/aio/aio_test.c
696 ↗(On Diff #30734)

Blank line before a comment. In this case I'd probably just move the comment up a line.

In D11468#239821, @jhb wrote:

I'm a bit leery of the symlink thing for md cleanup, but presumably that permits cleanup if the external atf timeout kicks in? Also, it seems you've removed the explicit timeout in favor of the ATF one?

Yep. If the ATF timeout kicks in, then Kyua will terminate the test process and create a new test process to run the cleanup routine. The cleanup routine always runs in its own process, which is why you need to use files or something like them to pass information from the test to its cleanup. Using a file would be the obvious way to do it, but using a symlink takes fewer SLOC. I copied the technique used in tests/sys/kern/kern_descrip_test.c. Using the ATF timeout and cleanup is better than the explicit version because the cleanup will always get run, regardless of termination reason. And it's many fewer SLOC, too.

Ok, I think it's fine to use ATF's timeout certainly. However, that is something that definitely needs mentioning in the commit logs. If it isn't too much trouble, it would probably be nice to split that change (switching to ATF timeout and redoing cleanups, etc.) into one commit first and then doing a second one to add the new sigevent tests. There's no need to re-post those for review though, you can mark both of them as reviewed.

This revision is now accepted and ready to land.Jul 13 2017, 10:29 PM
This revision was automatically updated to reflect the committed changes.