<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>26917</bug_id>
          
          <creation_ts>2009-07-01 22:24:39 -0700</creation_ts>
          <short_desc>Increase delay in worker-terminate layout test to make it more reliable.</short_desc>
          <delta_ts>2009-07-03 04:01:19 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dmitry Titov">dimich</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>levin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>129459</commentid>
    <comment_count>0</comment_count>
    <who name="Dmitry Titov">dimich</who>
    <bug_when>2009-07-01 22:24:39 -0700</bug_when>
    <thetext>The worker-terminate tests starts workers that replay with a message to a message (like echo), then posts a message to them, immediately calls &apos;worker.terminate()&apos; and then waits for a while to check that after calling &apos;terminate()&apos; there is nothing coming back from the worker (it was terminated). To make sure the worker started at all, before &apos;terminate()&apos; it may wait for the first message to come back (and be captured in results).

Current timeout for create a worker -&gt; postMessage(&apos;ping1&apos;) -&gt; wait for &apos;pong&apos; from the worker -&gt; call terminate() -&gt; postMessage(&apos;ping2&apos;) - wait to see that there is no &apos;pong2&apos; is set to 500ms.

On debug builds (of multi-process Chromium) and virtual test machines the time until first pong returns is roughly 500ms these days. So the test is flakey in some test environments, giving a fals negative when the first &apos;pong&apos; is absent - and it doesn&apos;t even start to test that the &apos;pong2&apos; does not come during some time after since it exits.

It is better to avoid such delay-based tests in general. In this case, I can&apos;t think of a way to detect the termination of the worker other then to verify it doesn&apos;t return messages anymore...

Proposed patch moves start of the timeout after &apos;pong1&apos; and increases the timeout 2x to make test more reliable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129460</commentid>
    <comment_count>1</comment_count>
      <attachid>32169</attachid>
    <who name="Dmitry Titov">dimich</who>
    <bug_when>2009-07-01 22:29:39 -0700</bug_when>
    <thetext>Created attachment 32169
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129510</commentid>
    <comment_count>2</comment_count>
      <attachid>32169</attachid>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2009-07-02 09:11:01 -0700</bug_when>
    <thetext>Comment on attachment 32169
Proposed patch

R=me, but it sure would be nice if there were a way to construct a
test that wasn&apos;t timing sensitive.  Adding delays to the layout
tests just slows down running all of the layout tests, and if 500ms
wasn&apos;t enough, then sometimes (maybe only rarely) 1000ms will also
not be enough.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129514</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry Titov">dimich</who>
    <bug_when>2009-07-02 09:39:26 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 32169 [review])
&gt; R=me, but it sure would be nice if there were a way to construct a
&gt; test that wasn&apos;t timing sensitive.

Absolutely. There is a separate discussion on how to test termination of workers (dedicated and shared) - seems we&apos;ll need to implement additional API on layoutTestController since the GC and actual destruction of workers is intentionally designed to be undetectable from a &apos;normal&apos; page.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129544</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-07-02 12:17:24 -0700</bug_when>
    <thetext>Do we have a follow-up bug about termination testing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129701</commentid>
    <comment_count>5</comment_count>
    <who name="Dmitry Titov">dimich</who>
    <bug_when>2009-07-03 04:01:19 -0700</bug_when>
    <thetext>Landed: http://trac.webkit.org/changeset/45533</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>32169</attachid>
            <date>2009-07-01 22:29:39 -0700</date>
            <delta_ts>2009-07-02 09:11:01 -0700</delta_ts>
            <desc>Proposed patch</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>1527</size>
            <attacher name="Dmitry Titov">dimich</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0xheW91dFRlc3RzL0NoYW5nZUxvZyBiL0xheW91dFRlc3RzL0NoYW5nZUxv
ZwppbmRleCAwMzU2ZjNiLi5kZDQxMjQ0IDEwMDY0NAotLS0gYS9MYXlvdXRUZXN0cy9DaGFuZ2VM
b2cKKysrIGIvTGF5b3V0VGVzdHMvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTcgQEAKKzIwMDktMDct
MDEgIERtaXRyeSBUaXRvdiAgPGRpbWljaEBjaHJvbWl1bS5vcmc+CisKKyAgICAgICAgUmV2aWV3
ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgSW5jcmVhc2UgZGVsYXkgaW4gd29ya2Vy
LXRlcm1pbmF0ZSBsYXlvdXQgdGVzdCB0byBtYWtlIGl0IG1vcmUgcmVsaWFibGUuCisgICAgICAg
IGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0yNjkxNworCisgICAgICAg
IFRoaXMgdGVzdCB1c2VkIHRpbWUgZGVsYXkgdG8gc2VlIG9mIHRlcm1pbmF0ZWQgd29ya2VyIGRv
ZXMgbm90IHJldHVybgorICAgICAgICBtZX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GF5b3V0VGVzdENvbnRyb2xsZXIp
IGxheW91dFRlc3RDb250cm9sbGVyLm5vdGlmeURvbmUoKSIsIDEwMDApOwogfQogd29ya2VyNC5w
b3N0TWVzc2FnZSgiZXZhbCB0cnVlIik7CiAKLXNldFRpbWVvdXQoImxvZygnRE9ORScpOyBpZiAo
d2luZG93LmxheW91dFRlc3RDb250cm9sbGVyKSBsYXlvdXRUZXN0Q29udHJvbGxlci5ub3RpZnlE
b25lKCkiLCA1MDApOwotCiA8L3NjcmlwdD4KIDwvYm9keT4KIDwvaHRtbD4K
</data>
<flag name="review"
          id="16666"
          type_id="1"
          status="+"
          setter="fishd"
    />
          </attachment>
      

    </bug>

</bugzilla>