Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Deterministic Scheduler variant which doesn't throw exception on shutdown #62

Open
ittaiz opened this issue Aug 3, 2014 · 4 comments

Comments

@ittaiz
Copy link
Contributor

ittaiz commented Aug 3, 2014

Hi,
I'm trying to use the deterministic scheduler in a test where the SUT calls scheduler.shutdown and I can't use it because it throws an exception.
I changed the behaviour and the build still passes which suggests a bit that this hasn't been decided (at least formally).
I think a variant is better than changing the current behaviour since some people might be relying on it already.
WDYT?
Seeing as 2.6.1 release seems really close I'd like to try and sneak this as another PR to get them both in (assuming you think it's relevant).
My current resolution is extending the jmock scheduler and overriding those 4 methods but I'd like this ShutdownAllowingDeterministicScheduler to be part of jmock.

@ittaiz
Copy link
Contributor Author

ittaiz commented Dec 19, 2015

Since 2.8.1 was released and the project has regained some activity I thought I'd ping here again.
you can take a look at this gist I made to get a sense of what I meant.
WDYT?

@olibye
Copy link
Member

olibye commented Dec 19, 2015

Can you write a test that would fail currently, then your solution with a
passing test? All in a pull request?

On Sat, 19 Dec 2015 9:04 pm Ittai Zeidman [email protected] wrote:

Since 2.8.1 was released and the project has regained some activity I
thought I'd ping here again.
you can take a look at this gist
https://gist.github.com/ittaiz/8cb0df991d2c773f4583 I made to get a
sense of what I meant.
WDYT?


Reply to this email directly or view it on GitHub
#62 (comment)
.

@ittaiz
Copy link
Contributor Author

ittaiz commented Dec 20, 2015

i definitely can thanks!
will link the PR here

@ittaiz
Copy link
Contributor Author

ittaiz commented Dec 23, 2015

Just to be clear- you'd like the implementation of shutdown/shutdownNow/isShutdown/isTerminated to be correct according to the javadoc or would any naive solution work? For my needs I just need the scheduler not to throw an exception but I'm guessing that if you won't throw UnsupportedOperationException because shutdown is support you'd rather have a more complete implementation. Is that assumption true?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants