Bug 227918

Summary: REGRESSION: [iOS] TestWebKitAPI.InAppBrowserPrivacy.AppBoundDomainAllowsServiceWorkers is failing
Product: WebKit Reporter: ayumi_kojima
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: aakash_jain, ap, bfulgham, jbedard, katherine_cheney, tsavell, webkit-bot-watchers-bugzilla, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: iPhone / iPad   
OS: Unspecified   

Description ayumi_kojima 2021-07-13 13:41:14 PDT
TestWebKitAPI.InAppBrowserPrivacy.AppBoundDomainAllowsServiceWorkers

Is constantly failing on iOS 14 E Simulator.

History: https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.InAppBrowserPrivacy.AppBoundDomainAllowsServiceWorkers

==================

/Volumes/Data/worker/ios-simulator-14-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:842
Expected equality of these values:
1u
Which is: 1
[websiteDataRecords count]
Which is: 2

==================

https://build.webkit.org/#/builders/28/builds/2401/steps/12/logs/stdio
Comment 1 Radar WebKit Bug Importer 2021-07-13 13:41:39 PDT
<rdar://problem/80535625>
Comment 2 ayumi_kojima 2021-07-13 15:31:54 PDT
I was not able to reproduce the failure on my local machine with run-api-tests TestWebKitAPI.InAppBrowserPrivacy.AppBoundDomainAllowsServiceWorkers --iOS-simulator
Comment 3 Truitt Savell 2021-07-13 16:08:28 PDT
I was able to reproduce this issue on the iOS tester machine with command:

run-api-tests --no-build --release --verbose --iphone-simulator TestWebKitAPI.InAppBrowserPrivacy.AppBoundDomainAllowsServiceWorkers --iterations 10
Comment 4 Aakash Jain 2021-07-15 07:27:30 PDT
Disabled the test for now (to speed up EWS) in https://trac.webkit.org/changeset/279945/webkit
Comment 5 Jonathan Bedard 2021-07-15 07:33:53 PDT
(In reply to ayumi_kojima from comment #2)
> I was not able to reproduce the failure on my local machine with
> run-api-tests
> TestWebKitAPI.InAppBrowserPrivacy.AppBoundDomainAllowsServiceWorkers
> --iOS-simulator

That's a bit surprising, makes me wonder if this has something to do with some state on the simulated device.
Comment 6 Kate Cheney 2021-07-15 08:57:54 PDT
(In reply to Jonathan Bedard from comment #5)
> (In reply to ayumi_kojima from comment #2)
> > I was not able to reproduce the failure on my local machine with
> > run-api-tests
> > TestWebKitAPI.InAppBrowserPrivacy.AppBoundDomainAllowsServiceWorkers
> > --iOS-simulator
> 
> That's a bit surprising, makes me wonder if this has something to do with
> some state on the simulated device.

The failure seems to indicate that there is more website data than expected when registering a service worker. Maybe that state isn't being cleared properly.
Comment 7 Jonathan Bedard 2021-07-15 09:14:51 PDT
(In reply to Kate Cheney from comment #6)
> (In reply to Jonathan Bedard from comment #5)
> > (In reply to ayumi_kojima from comment #2)
> > > I was not able to reproduce the failure on my local machine with
> > > run-api-tests
> > > TestWebKitAPI.InAppBrowserPrivacy.AppBoundDomainAllowsServiceWorkers
> > > --iOS-simulator
> > 
> > That's a bit surprising, makes me wonder if this has something to do with
> > some state on the simulated device.
> 
> The failure seems to indicate that there is more website data than expected
> when registering a service worker. Maybe that state isn't being cleared
> properly.

I'll bet `run-api-tests TestWebKitAPI.InAppBrowserPrivacy --ios-simulator` will reproduce, in that case.

It's permissible, when running API tests, for tests in a single suite to be run in the same process, could that cause the issue?
Comment 8 Kate Cheney 2021-10-27 13:03:54 PDT
This was almost surely fixed by https://bugs.webkit.org/show_bug.cgi?id=227524, where I added code to clear the data records between tests.

*** This bug has been marked as a duplicate of bug 227524 ***
Comment 9 Kate Cheney 2021-10-27 13:09:45 PDT
Unskipped test here: https://trac.webkit.org/changeset/284939/webkit