Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Got this in http://qa.drupal.org/pifr/test/480823 (will trigger a re-test later and then it might no longer be visible)
Failed asserting that 16.96 is less than 15. Other TimerUnitTest.php 33 Drupal\Tests\Component\Utility\TimerUnitTest->testTimer()
Comment | File | Size | Author |
---|---|---|---|
#18 | 1960032.timer-test.18.patch | 1.76 KB | arlinsandbulte |
#16 | 1960032.timer-test.16.patch | 1.79 KB | arlinsandbulte |
#14 | 1960032.timer-test.14.patch | 1.75 KB | alexpott |
#4 | 1960032.timer-test.4.patch | 1.74 KB | alexpott |
#3 | timer-test-1960032-3.patch | 2.38 KB | tim.plunkett |
Comments
Comment #1
tim.plunkettThe result should have been ~10 milliseconds, not 16.96.
The original tests (before #1935970: Convert timer_* to a utility class and convert tests to phpunit) were waiting 4 *seconds*, and it was dropped to 5 milliseconds. Is that really reasonable to expect?
Comment #2
BerdirHm. I guess that when running 8 tests in parallel, it can sometimes happen that you have to wait a few milliseconds more than you wanted.
I'd suggest to simply double those values.
Comment #3
tim.plunkettComment #4
alexpottThere has only been one reported sighting of this failure...
Looking at the tests in \Drupal\Tests\Component\Utility\TimerUnitTest it seems we're testing the resolution of usleep as well as the ability of the Timer utility class. Perhaps just removing
$this->assertLessThan
assertions and doing the tests along the lines in the patch attached is sufficient.Comment #5
ParisLiakos CreditAttribution: ParisLiakos commentedanother one
http://qa.drupal.org/pifr/test/482078
Failed asserting that 21.72 is less than 20. Other TimerUnitTest.php 33 Drupal\Tests\Component\Utility\TimerUnitTest->testTimer()
Comment #6
msonnabaum CreditAttribution: msonnabaum commentedI changed it to 5ms because that's where it was stable after a couple hundred times of running it locally for myself. That may be too low if testbot is running a high loadavg. I think it's fine to raise it some, just not where it was.
Comment #7
msonnabaum CreditAttribution: msonnabaum commentedI suppose we could do what's in #4. If that's a good enough test though, I dont know that we need 4 assertions.
IMO raising the interval from 5ms to 50ms should do the trick, but I'm not necessarily opposed to #4.
Comment #8
BerdirJust had another one of those, "Failed asserting that 20.14 is less than 20. Other TimerUnitTest.php 33 Drupal\Tests\Component\Utility\TimerUnitTest->testTimer()".
Comment #9
chx CreditAttribution: chx commentedBlargh, we aren't exactly interested in the instruction speed of Timer::read. Ripping out the top is fine.
Comment #10
webchickWoohoo! Thanks for the fast turnaround on this one, folks. I agree those extra assertions seem superfluous.
Committed and pushed to 8.x. Thanks!
Comment #12
Heine CreditAttribution: Heine commentedOn todays checkout I still get frequent fails such as
Windows 8, phpunit via phpstorm, PHP 5.4.4 cli.
Comment #13
amateescu CreditAttribution: amateescu commentedI get the same kind of failures on the exact same setup, but W7 instead of 8.
Comment #14
alexpottWindow's users how does this work for you?
Comment #15
amateescu CreditAttribution: amateescu commentedWfm, yes :)
Comment #16
arlinsandbulte CreditAttribution: arlinsandbulte commentedMissing punctuation made the comments REALLY hard to read & understand.
So, I just fixed the comments & did some minor re-wording to them.
Still RTBC if tests pass.
Comment #18
arlinsandbulte CreditAttribution: arlinsandbulte commentedLet's try this again,
Comment #19
arlinsandbulte CreditAttribution: arlinsandbulte commentedThat's better.
Back to RTBC as I only slightly changed the comments.
Comment #20
arlinsandbulte CreditAttribution: arlinsandbulte commentedLooks like #18 was committed by webchick, but not marked fixed here.
Commit: http://drupalcode.org/project/drupal.git/commit/2d32931
Another critical off the list!
Comment #21
webchickOops. :D Forgot I did that. ;) Yay!