(self)
| 4432 | self.assertGreater(t, offset - self.CLOCK_RES) |
| 4433 | |
| 4434 | def test_timerfd_select(self): |
| 4435 | fd = self.timerfd_create(time.CLOCK_REALTIME, flags=os.TFD_NONBLOCK) |
| 4436 | |
| 4437 | rfd, wfd, xfd = select.select([fd], [fd], [fd], 0) |
| 4438 | self.assertEqual((rfd, wfd, xfd), ([], [], [])) |
| 4439 | |
| 4440 | # 0.25 second |
| 4441 | initial_expiration = 0.25 |
| 4442 | # every 0.125 second |
| 4443 | interval = 0.125 |
| 4444 | |
| 4445 | os.timerfd_settime(fd, initial=initial_expiration, interval=interval) |
| 4446 | |
| 4447 | count = 3 |
| 4448 | t = time.perf_counter() |
| 4449 | for _ in range(count): |
| 4450 | rfd, wfd, xfd = select.select([fd], [fd], [fd], initial_expiration + interval) |
| 4451 | self.assertEqual((rfd, wfd, xfd), ([fd], [], [])) |
| 4452 | self.assertEqual(self.read_count_signaled(fd), 1) |
| 4453 | t = time.perf_counter() - t |
| 4454 | |
| 4455 | total_time = initial_expiration + interval * (count - 1) |
| 4456 | self.assertGreater(t, total_time - self.CLOCK_RES) |
| 4457 | |
| 4458 | def check_timerfd_poll(self, nanoseconds): |
| 4459 | fd = self.timerfd_create(time.CLOCK_REALTIME, flags=os.TFD_NONBLOCK) |
nothing calls this directly
no test coverage detected