<?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>191864</bug_id>
          
          <creation_ts>2018-11-20 10:47:52 -0800</creation_ts>
          <short_desc>EWS iOS-sim bots sometimes fails to shutdown simulator</short_desc>
          <delta_ts>2018-11-29 12:44:37 -0800</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>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Aakash Jain">aakash_jain</reporter>
          <assigned_to name="Jonathan Bedard">jbedard</assigned_to>
          <cc>ap</cc>
    
    <cc>bburg</cc>
    
    <cc>commit-queue</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>glenn</cc>
    
    <cc>jbedard</cc>
    
    <cc>lforschler</cc>
    
    <cc>rniwa</cc>
    
    <cc>ryanhaddad</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1480534</commentid>
    <comment_count>0</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-11-20 10:47:52 -0800</bug_when>
    <thetext>EWS iOS bots sometimes fails to shutdown simulator. Following error is seen in the logs:

RuntimeError raised: Timed out while waiting for F856DA6C-99A9-4F53-A577-FF6214181E63 to shut down
Traceback (most recent call last):
  File &quot;/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py&quot;, line 85, in main
    run_details = run(port, options, args, stderr)
  File &quot;/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py&quot;, line 448, in run
    run_details = manager.run(args)
  File &quot;/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py&quot;, line 249, in run
    initial_results, retry_results, enabled_pixel_tests_in_retry = self._run_test_subset(default_device_tests, tests_to_skip)
  File &quot;/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py&quot;, line 293, in _run_test_subset
    self._clean_up_run()
  File &quot;/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py&quot;, line 342, in _clean_up_run
    self._port.clean_up_test_run()
  File &quot;/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/port/ios_simulator.py&quot;, line 103, in clean_up_test_run
    SimulatedDeviceManager.tear_down(self.host)
  File &quot;/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/xcode/simulated_device.py&quot;, line 444, in tear_down
    device.platform_device._tear_down(deadline - time.time())
  File &quot;/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/xcode/simulated_device.py&quot;, line 538, in _tear_down
    self._shut_down(deadline - time.time())
  File &quot;/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/xcode/simulated_device.py&quot;, line 524, in _shut_down
    raise RuntimeError(&apos;Timed out while waiting for {} to shut down&apos;.format(self.udid))
RuntimeError: Timed out while waiting for F856DA6C-99A9-4F53-A577-FF6214181E63 to shut down
Stopping HTTP server ...
Stopping WebSocket server ...



e.g.: https://webkit-queues.webkit.org/results/10084446</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1480539</commentid>
    <comment_count>1</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2018-11-20 10:55:27 -0800</bug_when>
    <thetext>This seems to be happening on all the iOS simulator bots (checked on ews121, ews122, ews123, ews124, ews125, ews126).


e.g.:
ews121:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot; *.log | wc -l
     326
ews122:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot; *.log | wc -l
     215
ews123:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot; *.log | wc -l
      36
ews124:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot; *.log | wc -l
     481
ews125:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot; *.log | wc -l
     285
ews126:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot; *.log | wc -l
      36


Also it seems to be happening for a while, atleast for 2 months.

e.g.:
ews124:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot; *.log
ios-sim-ews_2018-09-24_21-09.log:1212:    raise RuntimeError(&apos;Timed out while waiting for {} to shut down&apos;.format(self.udid))</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1481165</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2018-11-23 11:18:42 -0800</bug_when>
    <thetext>(In reply to Aakash Jain from comment #1)
&gt; This seems to be happening on all the iOS simulator bots (checked on ews121,
&gt; ews122, ews123, ews124, ews125, ews126).
&gt; 
&gt; 
&gt; e.g.:
&gt; ews121:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot;
&gt; *.log | wc -l
&gt;      326
&gt; ews122:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot;
&gt; *.log | wc -l
&gt;      215
&gt; ews123:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot;
&gt; *.log | wc -l
&gt;       36
&gt; ews124:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot;
&gt; *.log | wc -l
&gt;      481
&gt; ews125:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot;
&gt; *.log | wc -l
&gt;      285
&gt; ews126:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot;
&gt; *.log | wc -l
&gt;       36
&gt; 
&gt; 
&gt; Also it seems to be happening for a while, atleast for 2 months.
&gt; 
&gt; e.g.:
&gt; ews124:ios-sim-ews-logs buildbot$ grep -rn &quot;Timed out while waiting for&quot;
&gt; *.log
&gt; ios-sim-ews_2018-09-24_21-09.log:1212:    raise RuntimeError(&apos;Timed out
&gt; while waiting for {} to shut down&apos;.format(self.udid))

These logs alone aren&apos;t really actionable. How often is this happening and do we have spindumps or sysdiagnoses from any of these runs?

Basically what&apos;s happening here is that we&apos;re getting stuck when shutting down one of our managed simulators. This is especially strange since this simulator was (apparently) healthy enough to actually run tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1481167</commentid>
    <comment_count>3</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2018-11-23 11:21:07 -0800</bug_when>
    <thetext>Side note for future diagnosis: according to &lt;https://webkit-queues.webkit.org/results/10084446&gt;, this is definitely one of the managed simulators. We used 10 simulators, so the simulator which failed to shutdown was booted by the instance of run-webkit-tests which failed to shut it down. In other words, the simulator in question WAS NOT a stale simulator from a previous run.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1483055</commentid>
    <comment_count>4</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2018-11-29 11:38:47 -0800</bug_when>
    <thetext>I think I stumbled upon a solution to this while working on some related simulator/device stuff.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1483057</commentid>
    <comment_count>5</comment_count>
      <attachid>356028</attachid>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2018-11-29 11:42:17 -0800</bug_when>
    <thetext>Created attachment 356028
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1483095</commentid>
    <comment_count>6</comment_count>
      <attachid>356028</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-11-29 12:43:07 -0800</bug_when>
    <thetext>Comment on attachment 356028
Patch

Clearing flags on attachment: 356028

Committed r238684: &lt;https://trac.webkit.org/changeset/238684&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1483096</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-11-29 12:43:09 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1483100</commentid>
    <comment_count>8</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-11-29 12:44:37 -0800</bug_when>
    <thetext>&lt;rdar://problem/46350950&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>356028</attachid>
            <date>2018-11-29 11:42:17 -0800</date>
            <delta_ts>2018-11-29 12:43:07 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-191864-20181129114216.patch</filename>
            <type>text/plain</type>
            <size>1987</size>
            <attacher name="Jonathan Bedard">jbedard</attacher>
            
              <data encoding="base64">SW5kZXg6IFRvb2xzL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBUb29scy9DaGFuZ2VMb2cJKHJl
dmlzaW9uIDIzODY3OSkKKysrIFRvb2xzL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwz
ICsxLDE0IEBACisyMDE4LTExLTI5ICBKb25hdGhhbiBCZWRhcmQgIDxqYmVkYXJkQGFwcGxlLmNv
bT4KKworICAgICAgICBFV1MgaU9TLXNpbSBib3RzIHNvbWV0aW1lcyBmYWlscyB0byBzaHV0ZG93
biBzaW11bGF0b3IKKyAgICAgICAgaHR0cHM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ZVN0YXRlLlNIVVRfRE9XTjoKICAgICAgICAgICAgIHRpbWUuc2xlZXAoLjUpCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>