Bug 81024 - fast/loader/form-submission-after-beforeunload-cancel.html is flaky
Summary: fast/loader/form-submission-after-beforeunload-cancel.html is flaky
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Darin Fisher (:fishd, Google)
Depends on:
Reported: 2012-03-13 12:41 PDT by Darin Fisher (:fishd, Google)
Modified: 2012-03-13 16:11 PDT (History)
3 users (show)

See Also:

v1 patch: increase timeout (1.27 KB, patch)
2012-03-13 13:24 PDT, Darin Fisher (:fishd, Google)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Fisher (:fishd, Google) 2012-03-13 12:41:43 PDT
fast/loader/form-submission-after-beforeunload-cancel.html is flaky

On my system, it sometimes fails like this:

 CONFIRM NAVIGATION: Click 'Stay on Page'
+This tests that submitting a form a second time after canceling the first submission in a onbeforeunload handler is allowed. To test manually, follow the instructions in the JavaScript confirmation dialogs.

It looks like there is a race between the network stack (file:// loading) and the setTimeout(..., 0) that stamps the FAIL text.
Comment 1 Darin Fisher (:fishd, Google) 2012-03-13 12:45:29 PDT
Also, when the test fails, the next test run by DRT ends up with the following text prepended:

  CONFIRM NAVIGATION: Click 'Leave Page'

This suggests that the setTimeout code is running, trigging the notifyDone(), and then the form submission goes through.
Comment 2 Darin Fisher (:fishd, Google) 2012-03-13 13:24:47 PDT
Created attachment 131702 [details]
v1 patch:  increase timeout

I'm not a big fan of patches like this.  Obviously, disk reads could still
in exceptional cases take longer than 1 second, but this makes the test
far more stable.
Comment 3 Andy Estes 2012-03-13 13:52:12 PDT
Comment on attachment 131702 [details]
v1 patch:  increase timeout

The one second timeout is indeed unfortunate, but since it only applies to the failure case and gets rid of the flakiness, this seems okay.
Comment 4 WebKit Review Bot 2012-03-13 16:11:40 PDT
Comment on attachment 131702 [details]
v1 patch:  increase timeout

Clearing flags on attachment: 131702

Committed r110633: <http://trac.webkit.org/changeset/110633>
Comment 5 WebKit Review Bot 2012-03-13 16:11:45 PDT
All reviewed patches have been landed.  Closing bug.