<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/tests/sys/kqueue/libkqueue/timer.c, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>http://cgit.freebsd.org/src/atom?h=main</id>
<link rel='self' href='http://cgit.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<updated>2025-06-24T22:29:03Z</updated>
<entry>
<title>tests/kqueue: repair flaky test</title>
<updated>2025-06-24T22:29:03Z</updated>
<author>
<name>Gleb Smirnoff</name>
<email>glebius@FreeBSD.org</email>
</author>
<published>2025-06-24T22:28:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=994bec47ee7f38bd20366b812313b2ea0714ef19'/>
<id>urn:sha1:994bec47ee7f38bd20366b812313b2ea0714ef19</id>
<content type='text'>
The test arms timer for 500 msec and then sleeps 1 second and expects that
the timer would always fire exactly 2 times.  However, it has a chance to
legitimately fire only once.  This makes the test flaky.  Fix the test
reducing sleep time down to 495 msec.

The problem started to show up recently, and I attribute that to
626ea75ed2e9.  Before this revision sleep(3) was almost always sleeping
over 1000 msec, now it can sleep exactly 1000 msec.

Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D50996
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-16T17:54:16Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:16Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b3e7694832e81d7a904a10f525f8797b753bf0d3'/>
<id>urn:sha1:b3e7694832e81d7a904a10f525f8797b753bf0d3</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</content>
</entry>
<entry>
<title>kqueue tests: Add new EVFILT_TIMER regression tests from upstream</title>
<updated>2022-05-25T00:16:32Z</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2022-05-25T00:16:32Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d6d4f9b45e0be306bdaf53b2133b2cd0f7642167'/>
<id>urn:sha1:d6d4f9b45e0be306bdaf53b2133b2cd0f7642167</id>
<content type='text'>
One of the tests exposes the regression reported in PR 264131.

One test is disabled because FreeBSD does not support setting EV_ONESHOT
on an already-added periodic timer.  Though, in this case the flag is
simply ignored, which isn't ideal.

One test is slightly modified to set EV_ADD when reconfiguring a
disabled timer per some commentary in PR 258412.

Ideally we would re-import the test suite from libkqueue but there is a
fair bit of divergence so this will require some effort.  This just gets
us one small step closer while increasing test coverage.

PR:		258412
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
</content>
</entry>
<entry>
<title>kqueue: fix recent assertion</title>
<updated>2021-10-01T18:17:30Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2021-10-01T16:59:31Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2f4dbe279f6b5eb87ec493d96f6943ffdb603ba0'/>
<id>urn:sha1:2f4dbe279f6b5eb87ec493d96f6943ffdb603ba0</id>
<content type='text'>
NOTE_ABSTIME may also have a zero timeout, which indicates that we
should still fire immediately as an absolute time in the past.  A test
has been added for this one as well.

Fixes:	9c999a259f00 ("kqueue: don't arbitrarily restrict long-past...")
Point hat:	kevans
Reported by:	syzbot+1c8d1154f560b3930042@syzkaller.appspotmail.com
</content>
</entry>
<entry>
<title>kqueue: don't arbitrarily restrict long-past values for NOTE_ABSTIME</title>
<updated>2021-10-01T02:31:24Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2021-09-29T19:55:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9c999a259f00b35f0467acd351fea9157ed7e1e4'/>
<id>urn:sha1:9c999a259f00b35f0467acd351fea9157ed7e1e4</id>
<content type='text'>
NOTE_ABSTIME values are converted to values relative to boottime in
filt_timervalidate(), and negative values are currently rejected.  We
don't reject times in the past in general, so clamp this up to 0 as
needed such that the timer fires immediately rather than imposing what
looks like an arbitrary restriction.

Another possible scenario is that the system clock had to be adjusted
by ~minutes or ~hours and we have less than that in terms of uptime,
making a reasonable short-timeout suddenly invalid. Firing it is still
a valid choice in this scenario so that applications can at least
expect a consistent behavior.

Reviewed by:	kib, markj
Discussed with:	allanjude
Differential Revision:	https://reviews.freebsd.org/D32230
</content>
</entry>
<entry>
<title>tests: kqueue: fix some issues with now() on ILP32 platforms</title>
<updated>2020-04-20T00:47:28Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-04-20T00:47:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=0fbdc3726a50a2e5f8530f08da858d3ff175d960'/>
<id>urn:sha1:0fbdc3726a50a2e5f8530f08da858d3ff175d960</id>
<content type='text'>
There were ultimately two separate problems here:
- a 32-bit long cannot represent microseconds since 1970 (noted by ian)
- time_t is 32-bit on i386, so now() was wrong anyways even with the correct
  return type.

For the first, just explicitly use a uint64_t for now() and all of the
callers. For the second, we need to explicitly cast tv_sec to uint64_t
before it gets multiplied in the SEC_TO_US macro. Casting this instance
rather than generally in the macro was arbitrarily chosen simply because all
other uses are converting small relative time values.

The tests now pass on i386, at least; presumably other ILP32 will be fine
now as well.
</content>
</entry>
<entry>
<title>Fix various warnings in tests/sys/kqueue and bump WARNS</title>
<updated>2020-04-18T12:54:47Z</updated>
<author>
<name>Alex Richardson</name>
<email>arichardson@FreeBSD.org</email>
</author>
<published>2020-04-18T12:54:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c9c283bd3045c909671fc9aab250c35fe124ef35'/>
<id>urn:sha1:c9c283bd3045c909671fc9aab250c35fe124ef35</id>
<content type='text'>
Reviewed By:	kevans
Differential Revision: https://reviews.freebsd.org/D24296
</content>
</entry>
<entry>
<title>tests: kqueue: use a more precise timer for the NOTE_ABSTIME test</title>
<updated>2020-04-17T02:22:15Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-04-17T02:22:15Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c17dd0e88b5db94cf641e862f50bdad436704598'/>
<id>urn:sha1:c17dd0e88b5db94cf641e862f50bdad436704598</id>
<content type='text'>
Originally noticed while attempting to run the kqueue tests under
qemu-user-static, this apparently just happens sometimes when running in a
jail in general -- the timer will fire off "too early," but it's really just
the result of imprecise measurements (noted by cem).

Kicking this over to NOTE_USECONDS still tests the correct thing while
allowing it to work more consistently; a basic sanity test reveals that we
often end up coming in just less than 200 microseconds after the timer
fired off.

MFC after:	3 days
</content>
</entry>
<entry>
<title>kqueue tests: fix -fno-common build</title>
<updated>2020-04-06T23:08:07Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2020-04-06T23:08:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ce6a89e27cd190313be39bb479880aeda4778436'/>
<id>urn:sha1:ce6a89e27cd190313be39bb479880aeda4778436</id>
<content type='text'>
vnode_fd and kqfd are both shared among multiple CU; define them exactly
once.

In the case of vnode_fd, it was simply the declaration that needed
correction.

-fno-common will become the default in GCC10/LLVM11.

MFC after:	3 days
</content>
</entry>
<entry>
<title>Make whitespace more consistent in libkqueue tests.</title>
<updated>2018-11-27T15:12:34Z</updated>
<author>
<name>David Bright</name>
<email>dab@FreeBSD.org</email>
</author>
<published>2018-11-27T15:12:34Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d34048812292b714a0bf99967270d18fe3097c62'/>
<id>urn:sha1:d34048812292b714a0bf99967270d18fe3097c62</id>
<content type='text'>
After r337820, which "corrected" some spaces-instead-of-tab whitespace
issues in the libkqueue tests, jmg@ pointed out that these files were
originally space-based, not tab-spaced, and so the correction should
have been to get rid of the tabs that had been introduced in previous
changes, not the spaces. This change does that. This is a whitespace
only change; no functional change is intended.

Reported by:	jmg@
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
</content>
</entry>
</feed>
