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

IllegalStateException in Tester #1114

Closed
cancilla opened this issue Jun 26, 2017 · 2 comments
Closed

IllegalStateException in Tester #1114

cancilla opened this issue Jun 26, 2017 · 2 comments
Assignees

Comments

@cancilla
Copy link

I wrote JUnit tests using the Tester API in the Java topology. Using Topology Toolkit that was packaged with Streams 4.2.0.0, the tests runs fine. However, the same set of tests all fail using Topology Toolkit v1.6.0 packaged with Streams 4.2.1.0. Each of the tests returns the following exception:

java.lang.IllegalStateException: One use only
         at com.ibm.streamsx.topology.internal.tester.TupleCollection.checkOneUse(TupleCollection.java:467)
         at com.ibm.streamsx.topology.internal.tester.TupleCollection.complete(TupleCollection.java:484)
         at com.ibm.streamsx.topology.internal.tester.TupleCollection.complete(TupleCollection.java:480)
...

The problem is here: https://github.com/IBMStreams/streamsx.topology/blob/master/java/src/com/ibm/streamsx/topology/internal/tester/TupleCollection.java#L478-L480

Calling complete(StreamsContext<?> context, Condition<?> endCondition, long timeout, TimeUnit unit) calls checkOneUse(), followed by a call to an overloaded version of complete() that again calls checkOneUse(). I don't think the first call to checkOneUse() is required since it's going to get called in the overloaded method anyway.

Workaround: Call complete(StreamsContext<?> context, Map<String,Object> config, Condition<?> endCondition, long timeout, TimeUnit unit) and pass in an empty Map for config.

@ddebrunner
Copy link
Member

Fixed in pr #1115

@ddebrunner
Copy link
Member

Commits cherry-picked to v1_6

@ddebrunner ddebrunner changed the title [Java Topology] IllegalStateException in Tester IllegalStateException in Tester Jul 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants