Bug 227455

Summary: [webkitcorepy] Fix race condition in TaskPool unittests
Product: WebKit Reporter: Jonathan Bedard <jbedard>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, darin, dewei_zhu, ryanhaddad, slewis, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch ews-feeder: commit-queue-

Description Jonathan Bedard 2021-06-28 11:16:38 PDT
webkitcorepy.tests.task_pool_unittest.TaskPoolUnittest.test_invalid_shutdown is racey on EWS, because it relies on the parent process terminating it's children before the children have a chance to finish their computation.
Comment 1 Radar WebKit Bug Importer 2021-06-28 11:16:52 PDT
<rdar://problem/79873003>
Comment 2 Jonathan Bedard 2021-06-28 11:21:42 PDT
Created attachment 432410 [details]
Patch
Comment 3 Jonathan Bedard 2021-06-28 11:22:05 PDT
Failures like this one https://ews-build.webkit.org/#/builders/5/builds/55039/steps/11/logs/stdio are the ones I'm trying to address.
Comment 5 dewei_zhu 2021-06-28 12:02:32 PDT
Comment on attachment 432410 [details]
Patch

r=me, this seems to be a mitigation,  but theoretically doesn't fix the race itself.
Comment 6 Jonathan Bedard 2021-06-28 12:06:14 PDT
(In reply to dewei_zhu from comment #5)
> Comment on attachment 432410 [details]
> Patch
> 
> r=me, this seems to be a mitigation,  but theoretically doesn't fix the race
> itself.

It doesn't fix the race, but it's hard to see how we could (and still retain the test). The test is basically verifying that the parent can and does terminate a child process if it's taking too long to complete. We clearly want some kind of limit on how long the child runs, in case the parent actually isn't terminating the child
Comment 7 EWS 2021-06-28 12:11:39 PDT
Committed r279345 (239213@main): <https://commits.webkit.org/239213@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 432410 [details].
Comment 8 Jonathan Bedard 2021-07-28 08:39:48 PDT
Reopening to attach new patch.
Comment 9 Jonathan Bedard 2021-07-28 08:39:49 PDT
Created attachment 434429 [details]
Patch
Comment 10 Jonathan Bedard 2021-07-28 08:40:59 PDT
The original change didn't fix our flakiness. This test isn't super valuable in the first place, I think we should just delete it.
Comment 11 Darin Adler 2021-07-28 10:16:53 PDT
Comment on attachment 434429 [details]
Patch

How does deleting a function fix a race condition?
Comment 12 Darin Adler 2021-07-28 10:17:26 PDT
Comment on attachment 434429 [details]
Patch

Oh, I get it, deleting a test (not just a function).
Comment 13 dewei_zhu 2021-07-28 17:57:48 PDT
Comment on attachment 434429 [details]
Patch

r=me
Comment 14 EWS 2021-07-28 18:48:53 PDT
Committed r280412 (240052@main): <https://commits.webkit.org/240052@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434429 [details].