Bug 1725546 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Note that we were seeing this kind of failures before server side targets and we already had workaround for them (e.g. https://searchfox.org/mozilla-central/rev/8f08c21f093be1c1c42438697f8bca67af94fc77/devtools/client/inspector/grids/test/browser_grids_grid-outline-highlight-cell.js#31)

This bug should be about having a helper we can call to either:
- disable grid update on reflows (i.e. what's already existing in our tests, but centralized)
- Use `PromiseTestUtils.allowMatchingRejectionsGlobally` to ignore those Promise rejections, something like:

```lang=js
function slienceGetGridsOnReflowPromiseRejection() {
  const { PromiseTestUtils } = ChromeUtils.import(
    "resource://testing-common/PromiseTestUtils.jsm"
  );
  const removeRejectionException = PromiseTestUtils.allowMatchingRejectionsGlobally(
    /Connection closed.*getGrids failed/
  );
  registerCleanupFunction(removeRejectionException);
}
```

At the moment, any call to `PromiseTestUtils.allowMatchingRejectionsGlobally` will impact the whole test suite and there's no mechanism to remove an entry from it. We might want to do that as part of Bug 1655422.
Note that we were seeing this kind of failures before server side targets and we already had workaround for them (e.g. https://searchfox.org/mozilla-central/rev/8f08c21f093be1c1c42438697f8bca67af94fc77/devtools/client/inspector/grids/test/browser_grids_grid-outline-highlight-cell.js#31)

This bug should be about having a helper we can call to either:
- disable grid update on reflows (i.e. what's already existing in our tests, but centralized)
- Use `PromiseTestUtils.allowMatchingRejectionsGlobally` to ignore those Promise rejections, something like:

```lang=js
function silenceGetGridsOnReflowPromiseRejection() {
  const { PromiseTestUtils } = ChromeUtils.import(
    "resource://testing-common/PromiseTestUtils.jsm"
  );
  const removeRejectionException = PromiseTestUtils.allowMatchingRejectionsGlobally(
    /Connection closed.*getGrids failed/
  );
  registerCleanupFunction(removeRejectionException);
}
```

At the moment, any call to `PromiseTestUtils.allowMatchingRejectionsGlobally` will impact the whole test suite and there's no mechanism to remove an entry from it. We might want to do that as part of Bug 1655422.

Back to Bug 1725546 Comment 3