Jasmine 1.3 queueing makes async testing weird. In this case, we resolve a promise with the expectation that it asynchronously displays a notification. Then, in a waitsFor block on the next line, we subscribe to onDidAddNotification. The problem is that this waitsFor block might not even be run before the notification gets displayed. So the notification is displayed before we even subscribe to onDidAddNotification and the waitsForBlock gets stuck. This kind of thing seems especially frequent on Windows/AppVeyor.
The ideal fix would be to convert all these tests to JS and use async/await. Then we could synchronously subscribe to onDidAddNotification after resolving the promise and avoid this race. But in this case, I think using a looser condition should work as well.
/cc @atom/core @50Wliu because I think it's important that everyone understands this source of indeterminacy when combining Jasmine 1.3 waitsFor blocks with promises in async tests.
Jasmine 1.3 queueing makes async testing weird. In this case, we resolve a promise with the expectation that it asynchronously displays a notification. Then, in a
waitsFor
block on the next line, we subscribe toonDidAddNotification
. The problem is that thiswaitsFor
block might not even be run before the notification gets displayed. So the notification is displayed before we even subscribe toonDidAddNotification
and thewaitsForBlock
gets stuck. This kind of thing seems especially frequent on Windows/AppVeyor.The ideal fix would be to convert all these tests to JS and use
async
/await
. Then we could synchronously subscribe toonDidAddNotification
after resolving the promise and avoid this race. But in this case, I think using a looser condition should work as well.