Closed
Bug 465510
Opened 17 years ago
Closed 17 years ago
random failures on test_database_sync_after_addVisit.js
Categories
(Toolkit :: Places, defect)
Toolkit
Places
Tracking
()
RESOLVED
FIXED
mozilla1.9.1b3
People
(Reporter: mak, Assigned: mak)
Details
(Keywords: fixed1.9.1)
Attachments
(1 file, 1 obsolete file)
|
4.87 KB,
patch
|
sdwilsh
:
review+
|
Details | Diff | Splinter Review |
i see random failures for this test on the tinderboxes, especially on windows, see for example
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1227011143.1227014283.15580.gz
i suppose this is mostly a timer issue due to the sync timer being low (1s). Hwv we should investigate on why that happens.
| Assignee | ||
Updated•17 years ago
|
Target Milestone: --- → mozilla1.9.1
Comment 1•17 years ago
|
||
| Assignee | ||
Comment 2•17 years ago
|
||
i think we can rewrite the test to wait for sync notification and check elapsed time, that should solve the randomness.
| Assignee | ||
Comment 3•17 years ago
|
||
this should solve the randomness
Comment 4•17 years ago
|
||
Comment on attachment 351681 [details] [diff] [review]
patch
>+++ b/toolkit/components/places/tests/sync/test_database_sync_after_addVisit.js
>+var observer = {
>+ visitId: -1,
>+ visitTime: null,
>+ observe: function(aSubject, aTopic, aData) {
>+ if (aTopic == kSyncFinished && this.visitId != -1) {
>+ // remove the observer, we don't need to observe sync on quit
>+ os.removeObserver(this, kSyncFinished);
>+ // sanity check that sync has happened in a max of SYNC_INTERVAL * 5
>+ do_check_true(Date.now() - this.visitTime < SYNC_INTERVAL * 5);
This is still prone to failure. Just drop it.
>+// Used to update observer visitId
>+var historyObserver = {
>+ onVisit: function(aURI, aVisitId, aTime, aSessionId, aReferringId,
>+ aTransitionType, aAdded) {
>+ observer.visitTime = aTime;
>+ observer.visitId = aVisitId;
>+ hs.removeObserver(this, false);
There is no need to track visit time given my previous comment, but note that visitTime is a PRTime, which is in microseconds, and Date.now() is in milliseconds.
> // Now add the visit
>- let id = hs.addVisit(uri(TEST_URI), Date.now() * 1000, null,
>- hs.TRANSITION_TYPED, false, 0);
>+ hs.addVisit(uri(TEST_URI), Date.now() * 1000, null,
>+ hs.TRANSITION_TYPED, false, 0);
It'll still be nice to sanity check the id here, so you should stored it and check that it's the same in onVisit.
I'm really concerned that somehow our nsITimer orderings got interleaved. It doesn't seem to make a whole lot of sense to me, and these tinderbox machines must be running incredibly slow. *sigh*
Attachment #351681 -
Flags: review?(sdwilsh) → review-
| Assignee | ||
Comment 5•17 years ago
|
||
(In reply to comment #4)
> (From update of attachment 351681 [details] [diff] [review])
> >+++ b/toolkit/components/places/tests/sync/test_database_sync_after_addVisit.js
> >+var observer = {
> >+ visitId: -1,
> >+ visitTime: null,
> >+ observe: function(aSubject, aTopic, aData) {
> >+ if (aTopic == kSyncFinished && this.visitId != -1) {
> >+ // remove the observer, we don't need to observe sync on quit
> >+ os.removeObserver(this, kSyncFinished);
> >+ // sanity check that sync has happened in a max of SYNC_INTERVAL * 5
> >+ do_check_true(Date.now() - this.visitTime < SYNC_INTERVAL * 5);
> This is still prone to failure. Just drop it.
yes and no, i mean, it could fail if the statements would be damn slow or the system highly overloaded, but calculating 5 time the sync should catch all of them.
Instead VM timers would not hit this since at last if the timer does not proceed the check is always true... Hwv i agree to drop it.
> visitTime is a PRTime, which is in microseconds, and Date.now() is in
> milliseconds.
i was sure to have done the conversion, i was probably drunk then, will come with both patches updated to drop timer
| Assignee | ||
Comment 6•17 years ago
|
||
(In reply to comment #4)
> (From update of attachment 351681 [details] [diff] [review])
> >+++ b/toolkit/components/places/tests/sync/test_database_sync_after_addVisit.js
> >+ // sanity check that sync has happened in a max of SYNC_INTERVAL * 5
> >+ do_check_true(Date.now() - this.visitTime < SYNC_INTERVAL * 5);
> This is still prone to failure. Just drop it.
done
> >+ onVisit: function(aURI, aVisitId, aTime, aSessionId, aReferringId,
> >+ aTransitionType, aAdded) {
> >+ observer.visitTime = aTime;
> >+ observer.visitId = aVisitId;
> >+ hs.removeObserver(this, false);
> There is no need to track visit time
removed
> > // Now add the visit
> >- let id = hs.addVisit(uri(TEST_URI), Date.now() * 1000, null,
> >- hs.TRANSITION_TYPED, false, 0);
> >+ hs.addVisit(uri(TEST_URI), Date.now() * 1000, null,
> >+ hs.TRANSITION_TYPED, false, 0);
> It'll still be nice to sanity check the id here, so you should stored it and
> check that it's the same in onVisit.
I can't check in onVisit because it is called before we return the value, hwv i've added a sanity check in the observer for it
Attachment #351681 -
Attachment is obsolete: true
Attachment #351897 -
Flags: review?(sdwilsh)
Comment 7•17 years ago
|
||
Comment on attachment 351897 [details] [diff] [review]
patch v1.1
r=sdwilsh
Attachment #351897 -
Flags: review?(sdwilsh) → review+
| Assignee | ||
Comment 8•17 years ago
|
||
pushed to trunk:
http://hg.mozilla.org/mozilla-central/rev/b6aec13be588
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 9•17 years ago
|
||
pushed to 1.9.1 branch:
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/c9a496856722
Keywords: fixed1.9.1
| Assignee | ||
Updated•17 years ago
|
Target Milestone: mozilla1.9.1 → mozilla1.9.1b3
Updated•17 years ago
|
Flags: in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•