You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/04/19 15:45:49 UTC

[GitHub] [nifi] greyp9 opened a new pull request, #5976: NIFI-9925 - adjust tests to run without IPv4 affinity

greyp9 opened a new pull request, #5976:
URL: https://github.com/apache/nifi/pull/5976

   #### Description of PR
   
   Found a few unit tests that expect to be run in an IPv4 network environment.  Adjust those to also handle IPv6.
   
   Identified and remediated an issue causing sporadic failures of PutUDP in the context of a Java17 JRE.  
   
   ### For all changes:
   - [X] Is there a JIRA ticket associated with this PR? Is it referenced 
        in the commit message?
   
   - [X] Does your PR title start with **NIFI-XXXX** where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [X] Has your PR been rebased against the latest commit within the target branch (typically `main`)?
   
   - [X] Is your initial contribution a single, squashed commit? _Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not `squash` or use `--force` when pushing to allow for clean monitoring of changes._
   
   ### For code changes:
   - [X] Have you ensured that the full suite of tests is executed via `mvn -Pcontrib-check clean install` at the root `nifi` folder?
   - [X] Have you written or updated unit tests to verify your changes?
   - [X] Have you verified that the full build is successful on JDK 8?
   - [X] Have you verified that the full build is successful on JDK 11?
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the `LICENSE` file, including the main `LICENSE` file under `nifi-assembly`?
   - [ ] If applicable, have you updated the `NOTICE` file, including the main `NOTICE` file found under `nifi-assembly`?
   - [ ] If adding new Properties, have you added `.displayName` in addition to .name (programmatic access) for each of the new properties?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] greyp9 commented on a diff in pull request #5976: NIFI-9925 - adjust tests to run without IPv4 affinity

Posted by GitBox <gi...@apache.org>.
greyp9 commented on code in PR #5976:
URL: https://github.com/apache/nifi/pull/5976#discussion_r853263332


##########
nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/test/java/org/apache/nifi/snmp/factory/core/V1V2cSNMPFactoryTest.java:
##########
@@ -62,7 +65,7 @@ public void testFactoryCreatesSnmpManager() {
         final Snmp snmpManager = snmpFactory.createSnmpManagerInstance(snmpConfiguration);
 
         final String address = snmpManager.getMessageDispatcher().getTransportMappings().iterator().next().getListenAddress().toString();
-        assertEquals("0.0.0.0" + "/" + managerPort, address);
+        assertTrue(Pattern.compile("0.+?0/" + managerPort).matcher(address).matches());

Review Comment:
   ```
   Error:  Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.026 s <<< FAILURE! - in org.apache.nifi.snmp.factory.core.V1V2cSNMPFactoryTest
   Error:  org.apache.nifi.snmp.factory.core.V1V2cSNMPFactoryTest.testFactoryCreatesSnmpManager  Time elapsed: 0.004 s  <<< FAILURE!
   org.junit.ComparisonFailure: expected:<0[.0.0.]0/57867> but was:<0[:0:0:0:0:0:0:]0/57867>
   	at org.apache.nifi.snmp.factory.core.V1V2cSNMPFactoryTest.testFactoryCreatesSnmpManager(V1V2cSNMPFactoryTest.java:65)
   ```
   https://github.com/greyp9/nifi/runs/5843639160?check_suite_focus=true
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] exceptionfactory closed pull request #5976: NIFI-9925 - adjust tests to run without IPv4 affinity

Posted by GitBox <gi...@apache.org>.
exceptionfactory closed pull request #5976: NIFI-9925 - adjust tests to run without IPv4 affinity
URL: https://github.com/apache/nifi/pull/5976


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] greyp9 commented on a diff in pull request #5976: NIFI-9925 - adjust tests to run without IPv4 affinity

Posted by GitBox <gi...@apache.org>.
greyp9 commented on code in PR #5976:
URL: https://github.com/apache/nifi/pull/5976#discussion_r853237528


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutUDP.java:
##########
@@ -187,18 +187,17 @@ private void configureProperties(final String host) {
         runner.assertValid();
     }
 
-    private void sendTestData(final String[] testData) throws InterruptedException {
+    private void sendTestData(final String[] testData) {
         sendTestData(testData, DEFAULT_ITERATIONS, DEFAULT_THREAD_COUNT);
     }
 
-    private void sendTestData(final String[] testData, final int iterations, final int threadCount) throws InterruptedException {
+    private void sendTestData(final String[] testData, final int iterations, final int threadCount) {
         for (String item : testData) {
             runner.setThreadCount(threadCount);
             for (int i = 0; i < iterations; i++) {
                 runner.enqueue(item.getBytes());
-                runner.run(1, false);

Review Comment:
   Each invocation of `runner.run()` causes the processor methods annotated with `@OnScheduled` to be invoked.  For PutUDP (and other processors derived from AbstractPutEventProcessor), this caused reinitialization of the client ChannelPool.  So this unit test generated 500 network connections, each of which was used to send a single UDP packet to the test server.
   
   Java 17 seems to have different default network parameters, which increases the chance of this test failing in that environment.  Since the test explicitly instructs PutUDP to reuse the ChannelPool connection, the updated method honors that intent.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] greyp9 commented on a diff in pull request #5976: NIFI-9925 - adjust tests to run without IPv4 affinity

Posted by GitBox <gi...@apache.org>.
greyp9 commented on code in PR #5976:
URL: https://github.com/apache/nifi/pull/5976#discussion_r853242353


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutUDP.java:
##########
@@ -58,7 +58,7 @@ public class TestPutUDP {
     private final static char CONTENT_CHAR = 'x';
     private final static int DATA_WAIT_PERIOD = 50;
     private final static int DEFAULT_TEST_TIMEOUT_PERIOD = 10000;
-    private final static int LONG_TEST_TIMEOUT_PERIOD = 100000;
+    private final static int LONG_TEST_TIMEOUT_PERIOD = 30000;

Review Comment:
   The failure mode of the load test was to send 500 messages, of which ~2-3 were dropped.  The 497 successful connections were received in a couple of seconds, then the test waits for the remaining failed packets, which will never be received.
   
   Adjusting this timeout down to a number that matches expected behavior.  If it doesn't succeed in 30 seconds, it likely won't succeed in 100 seconds. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org