Closed Bug 616152 Opened 15 years ago Closed 14 years ago

Timeout failure while waiting for default homepage in testNewWindow.js

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronmt, Assigned: whimboo)

References

()

Details

(Keywords: regression, Whiteboard: [mozmill-test-failure][needs-mozmill-1.5.2])

Attachments

(4 files, 3 obsolete files)

MODULE: testNewWindow.js TEST: testNewWindow ERROR: waitForEval: Timeout exceeded for 'subject.targetURL.value == subject.currentURL' BRANCH: default PLATFORM: Linux/Windows APPLICATION: Firefox 4.0b8pre (2.0b8pre, en-US, 20101202030316) Recent reports: Linux Ubuntu 10.4 - http://mozmill-release.brasstacks.mozilla.com/#/general/report/2c37a7c1942414e420c43bdb342f9a30 Windows NT 5.1.2600 - http://mozmill-release.brasstacks.mozilla.com/#/general/report/2c37a7c1942414e420c43bdb342fca99 Windows NT 6.1.7600 - http://mozmill-release.brasstacks.mozilla.com/#/general/report/2c37a7c1942414e420c43bdb342fa8e8 Location of error - http://hg.mozilla.org/qa/mozmill-tests/file/487ee592b42f/firefox/testTabbedBrowsing/testNewWindow.js#l87
OS: Mac OS X → Linux
Assignee: nobody → aaron.train
The problem is that the test is failing when it handles the wrong window. The current sleep solution is demonstrating that it is not reliable [1]. Is there a reliable way to wait for the new window? [1] http://hg.mozilla.org/qa/mozmill-tests/file/e885ee9e1007/firefox/testTabbedBrowsing/testNewWindow.js#l72
I'm wondering if there is something we could throw into a waitFor()? In fact, maybe we should have a controller.closeWindow() function? The function would not only close the window, but do a check to ensure the window is closed.
In particular, this is in regards to a newly opened window, but yes, I vouch for the logic to be handled in utils::handleWindow preferably.
Removed the sleep, and changed the window handler to use the default window title which in turn references the most recently opened window. Works like a charm.
Attachment #497584 - Flags: review?(hskupin)
Comment on attachment 497584 [details] [diff] [review] Patch v1 - (default) [checked-in] >+ controller2 = utils.handleWindow("type", "", > checkDefaultHomepage, false); Please move the parameters up, so we only have one single line. Otherwise r=me.
Attachment #497584 - Flags: review?(hskupin) → review+
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
From testing locally and on the machines I have been unable to reproduce the issue. I was suspecting the issue is similarily akin to the order of testing from script investigation by Anthony.
How did you run the tests? With Mozmill directly or with the testrun_general.py script? The latter one should be the first step to try.
Status: REOPENED → ASSIGNED
(In reply to comment #9) > How did you run the tests? With Mozmill directly or with the testrun_general.py > script? The latter one should be the first step to try. Both actually. I tested on XP/Vista/7 and Ubuntu, running mozmill directly and testrun_general.py, in the logs they show this as a pass. Is the configuration different in the daily testrun?
No, there is no difference. But if those failures persist, I would recommend to update the test so we add the value of both elements to the report (get - expected). That way it could give us a hint where to start.
Any progress on this failure? Can we please completely disable the test for the time being, so we don't have those errors?
OS: Linux → All
Have not been able to reproduce at all on the machines running testrun_general across platforms and branches, the test itself and the test collection module.
Attachment #501648 - Flags: review?(hskupin)
Depends on: 623934
Comment on attachment 501648 [details] [diff] [review] Patch v1 - (default) - [Enable skip test] Lets wait for the more detailed test failure.
Attachment #501648 - Flags: review?(hskupin)
Alright, the issue we are facing here is clear now: Current URL should be identical to the target URL - got about:home, expected http://www.mozilla.org/projects/firefox/prerelease.html Aaron, do you want to continue and fix this test?
Dave and I took some investigation this morning both locally and remotely but have so far come up dry in terms of being able to reproduce. I'm not entirely sure where/what to look at next would be.
(In reply to comment #16) > Dave and I took some investigation this morning both locally and remotely but > have so far come up dry in terms of being able to reproduce. I'm not entirely > sure where/what to look at next would be. I've recently discovered that some of our failures are only happening on qa-horus. For example, testPasswordNotSaved only fails in the daily testrun on qa-horus; it does not fail on the daily testrun from qa-set nor locally. Can you see if this is one such failure?
> I've recently discovered that some of our failures are only happening on > qa-horus. For example, testPasswordNotSaved only fails in the daily testrun on > qa-horus; it does not fail on the daily testrun from qa-set nor locally. Can > you see if this is one such failure? Been testing on qa-horus included already. My only other idea, is if possible to watch the daily test-runs in view
I have taken a look at this and it is somehow suspicious. The default homepage on 4.0 is definitely 'about:home' but expect to see "http://www.mozilla.org/projects/firefox/prerelease.html". After searching a while I have found that this URL is loaded when you open the Release Notes via the help menu. For pre-releases we don't have release notes so we forward people to this address. That means that when the new window gets opened 'about:home' is somehow redirected to the above URL.
Ok, I believe I know what's going on here. We loosely handle the newly opened window in the handleWindow function. The reason is that we actually don't really have great support for multiple windows of the same type. Not by Mozmill itself nor in our shared modules. As you can see when opening the browser the above mentioned page is loaded as the initial page in the first tab. That's the only time this page really gets loaded. We are loading "about:blank" into that tab, but - I have no idea why - that could fail and the pre-release page is still open. Now we are opening the new window, but we could get the wrong window on slower machines. We don't really check that the window is different from controller.window. I propose that we fix that flaw in the test and check if that helps. Patch upcoming.
Aaron, I hope you are ok when I steal this bug from you.
Assignee: aaron.train → hskupin
Summary: Timeout failure in testNewWindow.js → Timeout failure while waiting for default homepage in testNewWindow.js
This patch updates the test to make sure that we are using the correct window.
Attachment #501648 - Attachment is obsolete: true
Attachment #502685 - Flags: review?(gmealer)
Comment on attachment 502685 [details] [diff] [review] Patch v1 (handle window correctly) Looks OK, so I r+'d. A little commentary below, though. >+ // Make sure that we work on the correct window >+ var windows = mozmill.utils.getWindows("navigator:browser"); >+ windows.forEach(function (window) { >+ if (window !== controller.window) >+ controller2 = new mozmill.controller.MozMillController(window); >+ }); > >- controller2 = utils.handleWindow("type", "", checkDefaultHomepage, false); >+ return !!controller2; However, it may make sense to add a break; at the end of the if block. I know there are only supposed to be two windows, but if there were a cleanup issue prior you might mistakenly have more. The way it is now will iterate through all of them, leaving controller2 assigned the last. A break would leave controller2 assigned the first. I'm not sure how the windows are stored, and thus which one is the most recent. I'm also honestly a little torn as to whether we should aim to make the test always work (pick most recent), or to intentionally break on a previous cleanup error (pick least recent). I lean towards the latter. I'd be interested to know your viewpoint on that.
Attachment #502685 - Flags: review?(gmealer) → review+
(In reply to comment #23) > However, it may make sense to add a break; at the end of the if block. I know > there are only supposed to be two windows, but if there were a cleanup issue > prior you might mistakenly have more. That absolutely makes sense! Bad sadly forEach doesn't support break, so you will have to throw an exception or we can simply make use of the default for loop. I have changed the code to the latter path. > The way it is now will iterate through all of them, leaving controller2 > assigned the last. A break would leave controller2 assigned the first. I'm not > sure how the windows are stored, and thus which one is the most recent. I would say those are ordered by z position. Means the top-most window should appear first. So breaking the loop early is the right way to go. > I'm also honestly a little torn as to whether we should aim to make the test > always work (pick most recent), or to intentionally break on a previous cleanup > error (pick least recent). I lean towards the latter. I'd be interested to know > your viewpoint on that. That will not work because of slowness on some systems. As an alternative we could call getMostRecentWindow and wait until the controller's window is not the current window. But once a page gets opened behind the current window, our code would be broken. So I wouldn't use this way in general. Thanks Geo! I will check-in the current code, so we can check if it fixes our problems with this test. I'm not 100% sure it will, but lets see.
Landed as: http://hg.mozilla.org/qa/mozmill-tests/rev/4a0b6d2db468 (default) http://hg.mozilla.org/qa/mozmill-tests/rev/3c29a812f294 (1.9.2) http://hg.mozilla.org/qa/mozmill-tests/rev/2bce7e631257 (1.9.1) I will leave this bug open so we can check todays results and if we need to fix even more.
Attachment #502685 - Attachment is obsolete: true
Attachment #502776 - Flags: review+
Attachment #497584 - Attachment description: Patch v1 - (default) → Patch v1 - (default) [checked-in]
(In reply to comment #21) > Aaron, I hope you are ok when I steal this bug from you. Glad you figured it out, let's see results soon.
It seems like it would make sense to express disapproval (deprecate) of using handleWindow() for multiple windows as a result of this bug on the documentation at, https://developer.mozilla.org/en/Mozmill_Tests/Shared_Modules/UtilsAPI, but it isn't there in the first place. If this is desired, I can add it?
If we now have reason to believe that bug 580438 is causing this, shall we disable this test using one of the provided patches above until the dependancy is fixed?
Ok, this test fails only when the testrun gets executed via our testrun_all.py or testrun_daily.py scripts. Not sure why yet in detail but I suspect bug 580438.
Ok, we are blocked on bug 580438 here. As it looks like the additional --jsbridge=24242 option at the command line opens the browser with exactly a single tab. Keep in mind that we normally have two tabs open for the first start! We somehow stop to show the initial two pages, but those are getting opened exactly by this test in a new window. The first tab of this new window has the prerelease page open and it's causing this test to fail. Opening another window solves the problem. Lets see if I can find a workaround until bug 580438 has been fixed.
Depends on: 580438
So it is really caused by bug 580438. I have already attached a possible patch even when it is a workaround. For now I would just disable the test on Windows and Linux for all branches.
See bug 625614 for the underlying core issue.
Disable the test for now until Mozmill 1.5.2 has been released.
Attachment #503697 - Flags: review?(gmealer)
Comment on attachment 503697 [details] [diff] [review] Patch - temporarily disable test on Windows and Linux Kinda bummed that the only real way to do a platform-specific skip is exit early like this, since it means the test results will still show it passing. Code looks fine, r+.
Attachment #503697 - Flags: review?(gmealer) → review+
No, it's not. We can indeed skip it.
Attachment #503697 - Attachment is obsolete: true
Attachment #503706 - Flags: review?(gmealer)
Comment on attachment 503706 [details] [diff] [review] Patch - temporarily disable test on Windows and Linux (v2 - default) I really want to see this test passing in todays testrun. Switching review over to Aaron, so we can make sure it will be landed in-time, even for older branches.
Attachment #503706 - Flags: review?(gmealer) → review?(aaron.train)
Simple backport to 1.9.1
Attachment #503779 - Flags: review?(aaron.train)
Attachment #503706 - Flags: review?(aaron.train) → review+
Attachment #503779 - Flags: review?(aaron.train) → review+
Whiteboard: [mozmill-test-failure] → [mozmill-test-failure][needs-mozmill-1.5.2]
The above changes can now be reverted. Can we revert those changesets?
Henrik? Can those be backed out, or do new patches have to be made?
Status: ASSIGNED → RESOLVED
Closed: 15 years ago14 years ago
Resolution: --- → FIXED
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: