Bug 1254726 - fix intermittent test_action-clear-snapshots_06 (osx10.6);r=fitzgen
After enabling diff view and selecting two snapshots, wait for TAKE_CENSUS_DIFF_END
action in the test before deleting all snapshots. Otherwise, TAKE_CENSUS_DIFF_END
might be dispatched after clearSnapshots toggled diff mode off.
MozReview-Commit-ID: HNmIVn1SC8c
--- a/devtools/client/memory/test/unit/test_action-clear-snapshots_06.js
+++ b/devtools/client/memory/test/unit/test_action-clear-snapshots_06.js
@@ -34,18 +34,22 @@ add_task(function* () {
yield waitUntilSnapshotState(store,
[states.SAVED_CENSUS, states.SAVED_CENSUS]);
dispatch(toggleDiffing());
dispatch(selectSnapshotForDiffingAndRefresh(heapWorker,
getState().snapshots[0]));
dispatch(selectSnapshotForDiffingAndRefresh(heapWorker,
getState().snapshots[1]));
+
ok(getState().diffing, "We should be in diffing view");
+ yield waitUntilAction(store, actions.TAKE_CENSUS_DIFF_END);
+ ok(true, "Received TAKE_CENSUS_DIFF_END action");
+
ok(true, "Dispatch clearSnapshots action");
let deleteEvents = Promise.all([
waitUntilAction(store, actions.DELETE_SNAPSHOTS_START),
waitUntilAction(store, actions.DELETE_SNAPSHOTS_END)
]);
dispatch(clearSnapshots(heapWorker));
yield deleteEvents;
ok(true, "received delete snapshots events");