Bug 182370 - Fix race-condition in fast/forms/ios/ipad/select-form-run-twice.html
Summary: Fix race-condition in fast/forms/ios/ipad/select-form-run-twice.html
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Megan Gardner
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-31 18:24 PST by Jonathan Bedard
Modified: 2018-02-01 18:14 PST (History)
5 users (show)

See Also:


Attachments
Patch (2.26 KB, patch)
2018-01-31 18:34 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (6.27 KB, patch)
2018-02-01 16:46 PST, Megan Gardner
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2018-01-31 18:24:58 PST
fast/forms/ios/ipad/select-form-run-twice.html should wait for it's promise to be fulfilled before finishing the test. If it does not, the subsequent test may crash.
Comment 1 Jonathan Bedard 2018-01-31 18:34:03 PST
Created attachment 332830 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2018-01-31 18:34:21 PST
<rdar://problem/37098169>
Comment 3 Jonathan Bedard 2018-02-01 08:10:39 PST
Comment on attachment 332830 [details]
Patch

We need to go through and audit layout tests for outstanding promises when the test ends. I will not have time to do this thoroughly in the next few weeks, before I do the audit, I've asked the bot watchers to send me these sorts of test failures as they are found. This is another one of them.
Comment 4 Wenson Hsieh 2018-02-01 09:04:36 PST
Comment on attachment 332830 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=332830&action=review

> LayoutTests/fast/forms/ios/ipad/select-form-run-twice.html:37
> +            Promise.all(promises).then(function() {

`promises` is empty when we Promise.all here, so wouldn't this just resolve on the next runloop?
Comment 5 Jonathan Bedard 2018-02-01 09:10:26 PST
Comment on attachment 332830 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=332830&action=review

>> LayoutTests/fast/forms/ios/ipad/select-form-run-twice.html:37
>> +            Promise.all(promises).then(function() {
> 
> `promises` is empty when we Promise.all here, so wouldn't this just resolve on the next runloop?

For some reason I had thought that the other js functions had run already, but you are correct. I'll re-work this change.
Comment 6 Megan Gardner 2018-02-01 16:46:58 PST
Created attachment 332924 [details]
Patch
Comment 7 Tim Horton 2018-02-01 17:30:08 PST
Comment on attachment 332924 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=332924&action=review

> LayoutTests/ChangeLog:8
> +        Multiple potential button clicked, due to looping function calls can cause threads to be running in the next 

I think you grammared here.

Threads?
Comment 8 Megan Gardner 2018-02-01 18:14:09 PST
https://trac.webkit.org/r227992