Search the web
Sign In
New User? Sign Up
testdrivendevelopment · Test-driven Development
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Asynchronous processes   Message List  
Reply | Forward Message #7215 of 32009 |
Hey all!

I am writing some Oracle PL/SQL unit tests for a wrapper to an Oracle API
(Advanced Queueing). I'm having a problem with one test, which exercises a
procedure to flush the contents of a message queue. The code is correct but
the test frequently - not always - fails.

This is because the Oracle API works in an asynchronous fashion. I execute
the code to clear all the messages from the queue and /some/time/later/ all
the messages will be cleared from the queue. The problem is, my test that
this has happened (count=0) frequently fails because it hasn't happened when
my assertion runs.

Currently, I have a ten second sleep in my unit test. This means the test
passes sometimes and fails at other times. I have put an explanatory
message in the assertion code, but this strikes me as unsatisfactory. I
could further increase the sleep time in the unit test but who wants to wait
a minute for their tests to run? I can say "well it works" and remove the
unit test, but I don't like losing the coverage.

I'm sure people must have come across similar problems. There are probably
technology specific solutions (if you're working with Java Threads, say) but
is there a generic solution (pattern, approach)?

Cheers, APC



This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential information
and/or be subject to legal privilege. It should not be copied, disclosed to,
retained or used by, any other party. If you are not an intended recipient then
please promptly delete this e-mail and any attachment and all copies and inform
the sender. Thank you.




Wed Jul 21, 2004 8:07 am

Andrew.Clarke@...
Send Email Send Email

Forward
Message #7215 of 32009 |
Expand Messages Author Sort by Date

Hey all! I am writing some Oracle PL/SQL unit tests for a wrapper to an Oracle API (Advanced Queueing). I'm having a problem with one test, which exercises a ...
Clarke, Andrew
Andrew.Clarke@...
Send Email
Jul 28, 2004
3:14 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help