Make the server handler tests more stable
The tests were randomly failing due to the number of received change notifications in the test was sometimes not matching the expected number. This was because sometimes the thread with the FakeClient would race with the main test thread by starting replaying the test scenario before the main thread has acquired the NotificationController and installed QSignalSpy to it. In this case the QSignalSpy would have missed the notification. The fix is to split the FakeClient start up - first phase is for the FakeClient to connect to the server, then the test acquires the NotificationController and installes QSignalSpy on it and only after that it instructs the FakeClient to start replaying the test scenario.
Please register or sign in to comment