-
Notifications
You must be signed in to change notification settings - Fork 534
TCK: Request -1 in 309 instead of a random non-positive number #357
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
TCK: Request -1 in 309 instead of a random non-positive number #357
Conversation
@@ -884,8 +884,7 @@ public void required_spec309_requestNegativeNumberMustSignalIllegalArgumentExcep | |||
@Override | |||
public void run(Publisher<T> pub) throws Throwable { | |||
final ManualSubscriber<T> sub = env.newManualSubscriber(pub); | |||
final Random r = new Random(); | |||
sub.request(-r.nextInt(Integer.MAX_VALUE)); | |||
sub.request(-1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #352 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant "subtract 1 from the random value"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 is also invalid tho :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 is explicitly tested with required_spec309_requestZeroMustSignalIllegalArgumentException
.
Restored randomness and subtracted 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good improvement; should be good to squash/merge
if @reactive-streams/contributors agree we can merge |
Thanks @akarnokd! |
Make
required_spec309_requestNegativeNumberMustSignalIllegalArgumentException
deterministically request -1 as the negative number.