Page MenuHomeFreeBSD

Add timer_settime tests using SIGEV_THREAD.
ClosedPublic

Authored by jhb on Jul 5 2016, 7:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 2 2024, 5:55 AM
Unknown Object (File)
Oct 2 2024, 12:48 AM
Unknown Object (File)
Sep 25 2024, 5:14 PM
Unknown Object (File)
Sep 21 2024, 8:21 AM
Unknown Object (File)
Sep 18 2024, 12:07 PM
Unknown Object (File)
Sep 18 2024, 12:07 PM
Unknown Object (File)
Sep 18 2024, 12:07 PM
Unknown Object (File)
Sep 18 2024, 12:06 PM
Subscribers

Details

Summary

Add timer_settime tests using SIGEV_THREAD.

I'm not sure if it's better to commit this to the NetBSD test directly
or if we should add a FreeBSD-specific test file in src/lib/librt/tests.
The tests themselves should be POSIX and run fine on NetBSD in theory.

Test Plan
  • I ran one of these tests under gdb to test a patch to gdb to pass SIGLIBRT through to processes transparently by default (SIGEV_THREAD uses SIGLIBRT under the covers).

Diff Detail

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

Event Timeline

jhb retitled this revision from to Add timer_settime tests using SIGEV_THREAD..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: ngie.

Please add

#ifdef __FreeBSD__

around all FreeBSD specific changes.

I think contrib/netbsd-tests is due for a refresh. I'll do that in the upcoming weeks/couple months. Anything annotated will help me when doing that work.

Is this sensitive to wall clock time? The reason why I ask is that we run these tests on real hardware and virtual hardware at $work, and sometimes we'd run into spurious test failures with virtual hardware if the invariants checking was too pedantic, because the clock had "tocked".

contrib/netbsd-tests/lib/libc/sys/t_timer_create.c
159 ↗(On Diff #18163)

Why 2 seconds? What if this returns early?

In D7121#149375, @ngie wrote:

Please add

#ifdef __FreeBSD__

around all FreeBSD specific changes.

I think contrib/netbsd-tests is due for a refresh. I'll do that in the upcoming weeks/couple months. Anything annotated will help me when doing that work.

SIGEV_THREAD is in POSIX, so these should work fine on NetBSD as well.

In D7121#149376, @ngie wrote:

Is this sensitive to wall clock time? The reason why I ask is that we run these tests on real hardware and virtual hardware at $work, and sometimes we'd run into spurious test failures with virtual hardware if the invariants checking was too pedantic, because the clock had "tocked".

It is copy and pasted from the other tests. It should be no more broken than they are.

contrib/netbsd-tests/lib/libc/sys/t_timer_create.c
159 ↗(On Diff #18163)

It is copied from timer_signal_create().

In D7121#153095, @jhb wrote:

Ping?

Please add the #ifdef __FreeBSD__ blocks around new code introduced in FreeBSD. I'll work on "upstreaming" code soon to NetBSD from contrib/netbsd-tests -- adding #ifdef __(FreeBSD|NetBSD)__ makes it easier for me to discern code that needs to be merged from any incoming code.

contrib/netbsd-tests/lib/libc/sys/t_timer_create.c
159 ↗(On Diff #18163)

Ok.

Ah, it wasn't clear to me that you wanted #ifdef's around code that was applicable to NetBSD. I had assumed we only wanted that for tests that only ran on FreeBSD and were not applicable to NetBSD.

In D7121#153124, @jhb wrote:

Ah, it wasn't clear to me that you wanted #ifdef's around code that was applicable to NetBSD. I had assumed we only wanted that for tests that only ran on FreeBSD and were not applicable to NetBSD.

The general rule of thumb is:

  • __FreeBSD__: for FreeBSD; potentially upstreamable to NetBSD.
  • __NetBSD__: for NetBSD only (for features not available in FreeBSD, or behavior specific to NetBSD)
jhb edited edge metadata.
  • Add FreeBSD guards.
This revision was automatically updated to reflect the committed changes.