You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/11/13 10:55:00 UTC

[jira] [Commented] (FLINK-8040) Test instability ResourceGuard#testCloseBlockIfAcquired

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

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

GitHub user StefanRRichter opened a pull request:

    https://github.com/apache/flink/pull/5004

    [FLINK-8040] [tests] Fix test instability in ResourceGuardTest

    This PR only fixes a minor test instability in `ResourceGuardTest` and improves a bit on the comments.

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

    $ git pull https://github.com/StefanRRichter/flink FLINK-8040-test-instability

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

    https://github.com/apache/flink/pull/5004.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 #5004
    
----
commit b226d2879056dd1c52485d4653a4acfab9d15bbc
Author: Stefan Richter <s....@data-artisans.com>
Date:   2017-11-13T10:50:07Z

    [FLINK-8040] [tests] Fix test instability in ResourceGuardTest

----


> Test instability ResourceGuard#testCloseBlockIfAcquired
> -------------------------------------------------------
>
>                 Key: FLINK-8040
>                 URL: https://issues.apache.org/jira/browse/FLINK-8040
>             Project: Flink
>          Issue Type: Bug
>          Components: Core, Tests
>    Affects Versions: 1.4.0, 1.5.0
>            Reporter: Gary Yao
>            Assignee: Stefan Richter
>              Labels: test-stability
>             Fix For: 1.4.0, 1.5.0
>
>
> Test {{ResourceGuard#testCloseBlockIfAcquired()}} fails sporadically with 
> {noformat}
> java.io.IOException: Resource guard was already closed.
> 	at org.apache.flink.util.ResourceGuard.acquireResource(ResourceGuard.java:72)
> 	at org.apache.flink.util.ResourceGuardTest.testCloseBlockIfAcquired(ResourceGuardTest.java:74)
> 	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:498)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> 	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
> 	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
> {noformat}
> *How to reproduce*
> Run the test with a high number of iterations.
> To further provoke a failure, add {{Thread.sleep(100)}} before the following line
> {code}
> ResourceGuard.Lease lease_2 = resourceGuard.acquireResource();
> {code}
> This will more likely result in {{closed}} being {{true}} at the time the 2nd lease is acquired and an exception is thrown:
> {code}
> 	if (closed) {
> 		throw new IOException("Resource guard was already closed.");
> 	}
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)