XCTest waiting for expectation timeout does not trigger when using DispatchGroup
It might happen that when using DispatchGroup’s `wait` function the main thread could be blocked when testing.
This is because the wait function inside the command’s `execute` would block the running queue until all the tasks inside the group are complete.
In order to solve this issue, we could schedule the tested function on a global dispatch queue inside the test to let the dispatch group finish when the scheduled tasks are complete. This would prevent the `DispatchGroup` to block the main thread and the test expectation could be successfully fulfilled.