Increase timeout on async tests

32 views
Skip to first unread message

William Madden

unread,
Apr 11, 2012, 7:20:44 PM4/11/12
to mock...@googlegroups.com
Is it possible to increase the timeout of asynchronous tests, so that mocks aren't verified immediately?

I have an integration test that's testing moving focus from one object to another, and I want to let the framework dispatch the focus(In|Out) events, but they're dispatched after the mocks are verified, so the test fails.

I've tried [Test(async,timeout=99999)], but it doesn't seem to have any effect.

Drew Bourne

unread,
Apr 11, 2012, 10:02:43 PM4/11/12
to mock...@googlegroups.com
William, 

Can you include an example of a testcase? 

Are you also setting up an Async.proceedOnEvent() or Async.handleEvent() within your testcase to ensure the test waits for async completion before continuing? 

cheers, 
Drew

William Madden

unread,
Apr 12, 2012, 11:42:20 PM4/12/12
to mock...@googlegroups.com
Hi Drew,

Thanks for your reply. It was, as you said, because I didn't include an Async.proceedOnEvent() or handleEvent() call to force the test to wait. I had assumed the MockolateRule would do that already.

Cheers,
Will

Drew Bourne

unread,
Apr 13, 2012, 12:01:10 AM4/13/12
to mock...@googlegroups.com
Cool, glad that sorted it. 

cheers, 
Drew
Reply all
Reply to author
Forward
0 new messages