6

I've implemented an async server stream of messages and I have tests that call the rpc, then cause a message to be sent from the server, and then wait for the onNext().

Sometimes the tests fail because the rpc call arrives to the server after I cause a message. If I add a sleep of 300 millisecond on the server side, it fails consistently.

I've tried adding withWaitForReady() and it didn't help.

Is there a standard way to block an async stub until the method on the server side is finished?

Maxim Y
  • 339
  • 1
  • 6
  • It's not clear to me what's being asked. Part of this is I don't know whether it is client or server waiting for `onNext()` and what "cause a message" is talking about. "Blocking" an async stub is also confusing. Try rewording? – Eric Anderson Apr 22 '19 at 17:38

0 Answers0