nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markap14 <...@git.apache.org>
Subject [GitHub] nifi pull request: NIFI-1668 modified TestProcessorLifecycle to en...
Date Thu, 26 May 2016 17:14:43 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message