Opened 9 years ago

Closed 9 years ago

#1016 closed defect (fixed)

IntervalTimerTest shouldn't rely on the accuracy of the timer

Reported by: y-aharen Owned by: y-aharen
Priority: low Milestone: Sprint-20110802
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 2.0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

There're two tests which rely on the accuracy of the timer:

  • IntervalTimerTest.startIntervalTimer
  • IntervalTimerTest.overwriteIntervalTimer

The intention of the tests is not to test asio::deadline_timer, to test asiolink::IntervalTimer. Occasional failure of the tests can be solved with the following modifications.

  • IntervalTimerTest.startIntervalTimer
    • Test if the call back function will be called after the specified interval or longer instead of checking the elapsed time is within +/- 50 msec.
  • IntervalTimerTest.overwriteIntervalTimer
    • Test if the return value of getInterval() will be updated after calling setup() instead of measuring the time

Subtickets

Change History (10)

comment:1 Changed 9 years ago by shane

  • Milestone changed from New Tasks to Next-Sprint-Proposed

comment:2 Changed 9 years ago by stephen

  • Milestone changed from Next-Sprint-Proposed to Sprint-20110712

comment:3 Changed 9 years ago by stephen

  • Estimated Difficulty changed from 0.0 to 2

comment:4 Changed 9 years ago by vorner

  • Owner set to vorner
  • Status changed from new to accepted

comment:5 Changed 9 years ago by vorner

  • Owner changed from vorner to UnAssigned
  • Status changed from accepted to assigned

Hmm, it seems there's some work done by Aharen. Should I take it over and continue or leave it be for now?

comment:6 Changed 9 years ago by vorner

  • Owner changed from UnAssigned to vorner
  • Status changed from assigned to reviewing

OK, as agreed on jabber, this probably should be in review by now, so taking it directly.

comment:7 Changed 9 years ago by vorner

  • Owner changed from vorner to y-aharen

Hello

I think this should help and the code is clean. I just put a small cleanup there (few spaces at the end of lines and one too long line in the file), I hope it is OK.

I asked Jeremy to put it onto the build bots which usually fail to see if it fails or not. So, if it doesn't, I think it could be merged.

Thank you

comment:8 Changed 9 years ago by y-aharen

Vorner-san, thank you for reviewing. If the build bots doesn't fail, I'll merge the branch into trunk.

comment:9 Changed 9 years ago by shane

Aharen-san, please go ahead and merge this! Fewer build errors would be nice. :)

comment:10 Changed 9 years ago by y-aharen

  • Resolution set to fixed
  • Status changed from reviewing to closed

I've merged the branch into master. Thank you!

Note: See TracTickets for help on using tickets.