servo: Merge #11700 - Remove an invalid assertion in fire_timer (from Ms2ger:assert); r=jdm
authorMs2ger <Ms2ger@gmail.com>
Sat, 11 Jun 2016 18:42:53 -0500
changeset 339064 f86bfa474c9df82dde333532fb0b53a739705847
parent 339063 2ae6f118bbb305a1b35b8b9711a7e2c827185df8
child 339065 291f43a19a85aa92d5a3bbb452ee7ac8013a915a
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)
reviewersjdm
servo: Merge #11700 - Remove an invalid assertion in fire_timer (from Ms2ger:assert); r=jdm It's not clear to me if this is something we should expect to happen, but it does indeed happen, so we should disable the assertion while we investigate. Fixes #9984. Source-Repo: https://github.com/servo/servo Source-Revision: 3fa0dca3a32552a83ae020c57535346d9cdf3bdd
servo/components/script/timers.rs
--- a/servo/components/script/timers.rs
+++ b/servo/components/script/timers.rs
@@ -171,17 +171,20 @@ impl OneshotTimers {
             return;
         }
 
         assert!(self.suspended_since.get().is_none());
 
         let base_time = self.base_time();
 
         // Since the event id was the expected one, at least one timer should be due.
-        assert!(base_time >= self.timers.borrow().last().unwrap().scheduled_for);
+        if base_time < self.timers.borrow().last().unwrap().scheduled_for {
+            warn!("Unexpected timing!");
+            return;
+        }
 
         // select timers to run to prevent firing timers
         // that were installed during fire of another timer
         let mut timers_to_run = Vec::new();
 
         loop {
             let mut timers = self.timers.borrow_mut();