addons icon indicating copy to clipboard operation
addons copied to clipboard

Audit test suite for invalid tests due to async behaviour

Open bobsilverberg opened this issue 2 years ago • 1 comments

As discussed on Slack, and also mentioned in https://github.com/mozilla/addons/issues/14615, there are likely a number of tests in our suite that could generate false positives if bugs arise in our code due to the fact that our tests now need to deal with async changes.

This class of test is generally a test where we are checking that things do not change. For example, the UI does not change, or an action is not dispatched. Because we often have to wait for updates to our components before being able to accurately assert about the current state, there are likely tests that are currently passing not because the code is executing properly, but merely because we are not waiting for changes to occur. It is unlikely that any of these are currently false positives, but if a bug was introduced into the code that would have caused the test to fail, the test would keep passing because we haven't added the necessary code to wait for the change.

In some cases this will be impossible to test for, but in many others there are things we could await in order to make the tests valid.

Unfortunately, it doesn't seem like there is any way to uncover these other then looking through all of the tests one by one. This issue is about doing just that.

┆Issue is synchronized with this Jira Task

bobsilverberg avatar Jul 14 '22 18:07 bobsilverberg

Old Jira Ticket: https://mozilla-hub.atlassian.net/browse/ADDFRNT-90

KevinMind avatar May 03 '24 18:05 KevinMind