servo: Merge #10862 - Don't kill the root pipeline when randomly killing pipelines (from asajeffrey:only-the-chrome-survives); r=SimonSapin
authorAlan Jeffrey <ajeffrey@mozilla.com>
Tue, 26 Apr 2016 18:40:21 -0700
changeset 338636 05b17b3e36be24a043f4deb5aeac4ac99e07adae
parent 338635 fc5e9f3e946cfed7e044a1c1eff987793bb66f40
child 338637 6781eefa0c48be0ddae339b8fd024ebbb9d1e922
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersSimonSapin
servo: Merge #10862 - Don't kill the root pipeline when randomly killing pipelines (from asajeffrey:only-the-chrome-survives); r=SimonSapin Useful for stress-testing the browser chrome, e.g. testing #10334. Source-Repo: https://github.com/servo/servo Source-Revision: 959dbac0e7ca457d3979ff122ed4686eee209e91
servo/components/compositing/constellation.rs
--- a/servo/components/compositing/constellation.rs
+++ b/servo/components/compositing/constellation.rs
@@ -1864,16 +1864,18 @@ impl<LTF: LayoutThreadFactory, STF: Scri
             _ => return,
         };
         // In order to get repeatability, we sort the pipeline ids.
         let mut pipeline_ids: Vec<&PipelineId> = self.pipelines.keys().collect();
         pipeline_ids.sort();
         if let Some((ref mut rng, _)) = self.random_pipeline_closure {
             if let Some(pipeline_id) = rng.choose(&*pipeline_ids) {
                 if let Some(pipeline) = self.pipelines.get(pipeline_id) {
+                    // Don't kill the root pipeline
+                    if pipeline.parent_info.is_none() { return; }
                     // Note that we deliberately do not do any of the tidying up
                     // associated with closing a pipeline. The constellation should cope!
                     info!("Randomly closing pipeline {}.", pipeline_id);
                     pipeline.force_exit();
                 }
             }
         }
     }