Oleg Zhurakousky created NIFI-1143:
--------------------------------------

             Summary: Race condition during initialization of ControllerServices
                 Key: NIFI-1143
                 URL: https://issues.apache.org/jira/browse/NIFI-1143
             Project: Apache NiFi
          Issue Type: Bug
          Components: Core Framework
    Affects Versions: 0.3.0
            Reporter: Oleg Zhurakousky
            Assignee: Oleg Zhurakousky
             Fix For: 0.4.0


While merging NIFI-1061 [~joewitt] and I noticed a strange test failure:
{code}
Running org.apache.nifi.controller.service.TestStandardControllerServiceProvider
Tests run: 6, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.138 sec <<< 
FAILURE! - in 
org.apache.nifi.controller.service.TestStandardControllerServiceProvider
testEnableReferencingServicesGraph(org.apache.nifi.controller.service.TestStandardControllerServiceProvider)
  Time elapsed: 0.013 sec  <<< ERROR!
java.lang.IllegalStateException: ServiceA[id=1] cannot be enabled because it is 
not valid: []
at 
org.apache.nifi.controller.service.StandardControllerServiceNode.verifyCanEnable(StandardControllerServiceNode.java:176)
at 
org.apache.nifi.controller.service.StandardControllerServiceProvider.enableControllerService(StandardControllerServiceProvider.java:286)
at 
org.apache.nifi.controller.service.StandardControllerServiceProvider.enableReferencingServices(StandardControllerServiceProvider.java:565)
at 
org.apache.nifi.controller.service.StandardControllerServiceProvider.enableReferencingServices(StandardControllerServiceProvider.java:544)
at 
org.apache.nifi.controller.service.TestStandardControllerServiceProvider.testEnableReferencingServicesGraph(TestStandardControllerServiceProvider.java:141)
{code}
At first it was attributed to a small clean up change on 
_StandardProcessScheduler_ that went in with NIFI-1061. However the failure now 
is reproducible without the change to  _StandardProcessScheduler_. In fact 
running the test in repeat mode also produces a variation of a failure seen 
above:
{code}
java.lang.IllegalStateException: ServiceA[id=2] cannot be enabled because it is 
not valid: 'Other Service' validated against 'ServiceB' is invalid because 
Controller Service ServiceB[id=4] is disabled
        at 
org.apache.nifi.controller.service.StandardControllerServiceNode.verifyCanEnable(StandardControllerServiceNode.java:194)
        at 
org.apache.nifi.controller.service.StandardControllerServiceProvider.enableReferencingServices(StandardControllerServiceProvider.java:557)
        at 
org.apache.nifi.controller.service.StandardControllerServiceProvider.enableReferencingServices(StandardControllerServiceProvider.java:544)
        at 
org.apache.nifi.controller.service.TestStandardControllerServiceProvider.testEnableReferencingServicesGraph(TestStandardControllerServiceProvider.java:156)
        at 
org.apache.nifi.controller.service.TestStandardControllerServiceProvider.foo(TestStandardControllerServiceProvider.java:119)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        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.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
{code}




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

Reply via email to