Added a test for the case when we wait on a hub invocation from the client

#2153
Made changes as per code review feedback

#2153