[ 
https://issues.apache.org/jira/browse/FLINK-1207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14215196#comment-14215196
 ] 

ASF GitHub Bot commented on FLINK-1207:
---------------------------------------

GitHub user StephanEwen opened a pull request:

    https://github.com/apache/incubator-flink/pull/211

    [FLINK-1207] Context environments are realized through factories

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/StephanEwen/incubator-flink factories

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-flink/pull/211.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #211
    
----
commit 06c259f641ffcdb4e524370f85c4c9b12dcdfc28
Author: Stephan Ewen <[email protected]>
Date:   2014-11-17T20:55:51Z

    [tests] Various stability fixes to tests

commit ae07abe3781eb583774eab917953f31cf4925cd9
Author: Stephan Ewen <[email protected]>
Date:   2014-11-17T21:07:09Z

    [build] Manage version of joda-time to prevent conflicts between 
dependencies.

commit 83d02563ea4a1c7d05540849bf3bf033d968b021
Author: Stephan Ewen <[email protected]>
Date:   2014-11-17T18:04:13Z

    [FLINK-1207] Context environments are realized through factories
      - local execution blocking is reset after each run

----


> Switch ContextEnvironment to Environment factory
> ------------------------------------------------
>
>                 Key: FLINK-1207
>                 URL: https://issues.apache.org/jira/browse/FLINK-1207
>             Project: Flink
>          Issue Type: Bug
>          Components: Java API
>    Affects Versions: 0.8-incubating
>            Reporter: Stephan Ewen
>             Fix For: 0.8-incubating
>
>
> We implement the "context dependent switching" of the execution environments 
> (cluster / local / test) with static variables in the ExecutionEnvironment.
> That means that these environments are potentially shared between multiple 
> threads that run programs (also in case where they run one after the other).
> This may lead to exceptions, as we sometimes see in the tests, when using 
> forked test execution: The later test in the same JVM may access the same 
> environment object as the prior ones. In particular, we see that half 
> finished programs may still be associated with the execution environment, 
> such that mixes between programs occur, producing hard to understand cast 
> exceptions (see trace below)
> This is so far only relevant to tests with forked execution, but may become 
> relevant to users that build different programs at the same time.
> I propose to change the static members from environments to environment 
> factories. That way, we can switch type of environment depending on the 
> context as before, and we guarantee that each call to 
> "ExecutionEnvironment.getEnvironment()" returns a dedicated and fresh 
> environment.
> Running 
> org.apache.flink.api.scala.operators.translation.DistinctTranslationTest
> java.lang.ClassCastException: 
> org.apache.flink.api.common.operators.base.DeltaIterationBase cannot be cast 
> to org.apache.flink.api.common.operators.base.GroupReduceOperatorBase
>       at 
> org.apache.flink.api.scala.operators.translation.DistinctTranslationTest.testCombinable(DistinctTranslationTest.scala:39)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:483)
>       at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
>       at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>       at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
>       at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>       at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>       at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
>       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
>       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
>       at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
>       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
>       at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
>       at 
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.027 sec <<< 
> FAILURE! - in 
> org.apache.flink.api.scala.operators.translation.DistinctTranslationTest
> testCombinable(org.apache.flink.api.scala.operators.translation.DistinctTranslationTest)
>   Time elapsed: 0.024 sec  <<< FAILURE!
> java.lang.AssertionError: 
> org.apache.flink.api.common.operators.base.DeltaIterationBase cannot be cast 
> to org.apache.flink.api.common.operators.base.GroupReduceOperatorBase
>       at org.junit.Assert.fail(Assert.java:88)
>       at 
> org.apache.flink.api.scala.operators.translation.DistinctTranslationTest.testCombinable(DistinctTranslationTest.scala:46)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to