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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]