Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4437 from esl/carboncopy-flaky-test
Unflake the`dropped_client_doesnt_create_duplicate_carbons` test The description of #4423 was not entirely correct, and this PR should unlflake the tests for good. The reason why the tests are changed, and not the implementation is because the underlying race condition is a bit tricky to fix elegantly. mod_carboncopy:remove_connection is a handler for the unset_presence hook, and it removes CC state from the ejabberd_sm info field in the session record. This is however done in an async manner by the C2S process, and when the user terminates, the request is never handled. This doesn't matter much, as the user process exits shortly, and is removed from ejabberd_sm altogether. However, if they receives a message in this short time, CC might run, and see the process still with the CC state in the ejabberd_sm info field. This results in a CC copy sent on behalf of this exiting process. Since a fix would be overly complicated, and to proceed with unflaking the tests, the test will now wait for C2S process exit.
- Loading branch information