Mark Payne created NIFI-16500:
---------------------------------

             Summary: Remove unnecessary NiFi restart from 
AbstractNarSwapMigrationIT teardown
                 Key: NIFI-16500
                 URL: https://issues.apache.org/jira/browse/NIFI-16500
             Project: Apache NiFi
          Issue Type: Improvement
          Components: Tools and Build
            Reporter: Mark Payne
            Assignee: Mark Payne


{{AbstractNarSwapMigrationIT}} restarts NiFi in an {{@AfterEach}} method 
({{restoreNars}}) to move the original system test extension NARs back into 
{{lib}}. That restart has no effect. The class returns true from 
{{isDestroyEnvironmentAfterEachTest()}}, so the instance is discarded after 
every test. The next test's 
{{SpawnedStandaloneNiFiInstanceFactory.createEnvironment()}} deletes the 
instance directory and copies {{lib}} again from {{target/nifi-lib-assembly}}. 
The base class teardown also calls {{destroyFlow()}} first, which stops and 
deletes every component over the REST API before that same directory is deleted.

Remove {{restoreNars()}} and {{switchNarsBack()}}, and override 
{{isDestroyFlowAfterEachTest()}} to return false. {{isAllowFactoryReuse()}} 
must keep returning false, because it shuts down the shared cached instance 
that uses the same directory. This saves one NiFi start per test in 
{{PropertyMigrationIT}}, {{ConnectorPropertyMigrationIT}}, and any future 
subclass.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to