When running the tests for the Tracker module, I get one failed test in about half the times I try (the rest of the time, all tests pass):
111 passes, 1 fail, 0 exceptions
Message: New comments are counted on the tracker listing pages.
Group: Other
Filename: tracker.test
Line: 140
Function: TrackerTest->testTrackerNewComments()
I believe this happens because the test runs "too fast". testTrackerNewComments() posts a comment as one user, then posts a comment as another user and finally gets the tracker of the first user. If all this happens within the same second, the two comments get the same timestamp. AFAICT comment_num_new() doesn't detect that the second comment was added later than the first and returns 0 even though it should return 1.
If you have troubles reproducing this, you can "make the seconds longer" by adding the following to the top of index.php: $_SERVER['REQUEST_TIME'] -= $_SERVER['REQUEST_TIME'] % 10;
As long as the comment module doesn't offer subsecond precision, we might just add a sleep(1) to the test between the posting of the two comments.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | trackerfix.patch | 594 bytes | chx |
Comments
Comment #1
catchI get this sometimes too, since it's a test failiure, bumping to critical.
Comment #2
chx commentedHere we go. You guys have speedy machines :)
Comment #3
catchhmm, I can't reproduce this bug today, it's very inconsistent. Seems sensible though. If someone else can reproduce consistently - please test this patch! Will try on my other machine later.
Comment #4
c960657 commentedI just ran the test 10 times without the patch. The test failed 4 times.
I then ran the test 20 times with the patch. The test passed all runs.
So it looks like the patch fixes the problem.
Comment #5
catchThat's good enough for me :)
Comment #6
webchickExcellent. :) Thanks!
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.