Any idea how to handle following(the message is clear, but I'm not sure what I need to do) I'm opening "generic" environment in my code (StreamExecutionEnvironment.getExecutionEnvironment()) and JavaProgramTestBase configures TestEnvironment... so what I should do to support custom tests? Error: The LocalStreamEnvironment cannot be used when submitting a program through a client, or running in a TestEnvironment context. org.apache.flink.api.common.InvalidProgramException: The LocalStreamEnvironment cannot be used when submitting a program through a client, or running in a TestEnvironment context. at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.<init>(LocalStreamEnvironment.java:67) at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.<init>(LocalStreamEnvironment.java:57) at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.createLocalEnvironment(StreamExecutionEnvironment.java:1299) at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.createLocalEnvironment(StreamExecutionEnvironment.java:1285) at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.getExecutionEnvironment(StreamExecutionEnvironment.java:1271) at com.x.x.StreamConsumer.configureEnv(StreamConsumer.java:150) The error happens when using StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); in my program test is something like: public class StreamConsumerTest extends JavaProgramTestBase { @Override protected void preSubmit() throws Exception { } @Override protected void postSubmit() throws Exception { } @Override protected void testProgram() throws Exception { StreamConsumer.main(new String[] { "--" + StreamConsumer.CONF_PARAM, "conf/test", }); } } |
answering my own question: testing streaming environment should be done with StreamingProgramTestBase & TestStreamEnvironment which are present in test package of flink-streaming-java project so it's not directly available? Project owners, why not to move above two to flink-test-utils? Or I don't understand something? On 9 May 2016 at 19:37, Igor Berman <[hidden email]> wrote:
|
Hi,
Some shameless self promotion: You can also checkout: https://github.com/ottogroup/flink-spector which has to the goal to remove such hurdles when testing flink programs. Best, Alex |
thanks Alexander, I'll take a look On 10 May 2016 at 13:07, lofifnc <[hidden email]> wrote: Hi, |
Free forum by Nabble | Edit this page |