Github user markap14 commented on the pull request:

    https://github.com/apache/nifi/pull/324#issuecomment-221935156
  
    Agreed - I think moving the FlowController lifecycle to @Before and @After 
should address the issues. I do think that the 
validateIdempotencyOfProcessorStartOperation() test is a bit odd, though. Lots 
of tasks are kicked off in the background, which will test (to some degree) 
thread safety. However, if the goal is to test idempotency, then we should just 
call the method in the foreground multiple successive times, not run it in the 
background.
    
    If the goal is to test running it in the background and the associated 
thread-safety, then I'd recommend that rather than using the countdown latch we 
just do something like:
    
    ```
    while (testProcessor.operationNames.isEmpty() || 
testProcNode.getScheduledState() != ScheduledState.RUNNING) {
        Thread.sleep(10L);
    }
    ```
    
    And then set a 10-second timeout on the test: @Test(timeout=10000)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to