You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ad...@apache.org on 2021/02/22 08:58:03 UTC

[nifi-minifi-cpp] branch main updated: MINIFICPP-1497: Remove misleading ThreadPoolAdjust integration test

This is an automated email from the ASF dual-hosted git repository.

adebreceni pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new 597feea  MINIFICPP-1497: Remove misleading ThreadPoolAdjust integration test
597feea is described below

commit 597feea6fa04870b8107642083c6872216d3a067
Author: Martin Zink <ma...@protonmail.com>
AuthorDate: Mon Feb 22 09:55:28 2021 +0100

    MINIFICPP-1497: Remove misleading ThreadPoolAdjust integration test
    
    Signed-off-by: Adam Debreceni <ad...@apache.org>
    
    This closes #1009
---
 extensions/http-curl/tests/CMakeLists.txt       |  1 -
 extensions/http-curl/tests/ThreadPoolAdjust.cpp | 91 -----------------------
 libminifi/test/resources/ThreadPoolAdjust.yml   | 97 -------------------------
 3 files changed, 189 deletions(-)

diff --git a/extensions/http-curl/tests/CMakeLists.txt b/extensions/http-curl/tests/CMakeLists.txt
index 0cbb237..c182bf2 100644
--- a/extensions/http-curl/tests/CMakeLists.txt
+++ b/extensions/http-curl/tests/CMakeLists.txt
@@ -95,7 +95,6 @@ add_test(NAME HTTPSiteToSiteTests COMMAND HTTPSiteToSiteTests "${TEST_RESOURCES}
 add_test(NAME TimeoutHTTPSiteToSiteTests COMMAND TimeoutHTTPSiteToSiteTests "${TEST_RESOURCES}/TestTimeoutHTTPSiteToSite.yml" "${TEST_RESOURCES}/" "http://localhost:8098/nifi-api")
 add_test(NAME SiteToSiteRestTest COMMAND SiteToSiteRestTest "${TEST_RESOURCES}/TestSite2SiteRest.yml" "${TEST_RESOURCES}/" "http://localhost:8077/nifi-api/site-to-site")
 add_test(NAME ControllerServiceIntegrationTests COMMAND ControllerServiceIntegrationTests "${TEST_RESOURCES}/TestControllerServices.yml" "${TEST_RESOURCES}/")
-add_test(NAME ThreadPoolAdjust COMMAND ThreadPoolAdjust "${TEST_RESOURCES}/ThreadPoolAdjust.yml" "${TEST_RESOURCES}/")
 add_test(NAME VerifyInvokeHTTPTest COMMAND VerifyInvokeHTTPTest "${TEST_RESOURCES}/TestInvokeHTTPPost.yml")
 add_test(NAME AbsoluteTimeoutTest COMMAND AbsoluteTimeoutTest)
 add_test(NAME C2PauseResumeTest COMMAND C2PauseResumeTest "${TEST_RESOURCES}/C2PauseResumeTest.yml"  "${TEST_RESOURCES}/")
diff --git a/extensions/http-curl/tests/ThreadPoolAdjust.cpp b/extensions/http-curl/tests/ThreadPoolAdjust.cpp
deleted file mode 100644
index cb59aad..0000000
--- a/extensions/http-curl/tests/ThreadPoolAdjust.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#undef NDEBUG
-#include <cassert>
-#include <cstdio>
-#include <string>
-#include <iostream>
-#include "InvokeHTTP.h"
-#include "processors/ListenHTTP.h"
-#include "TestBase.h"
-#include "core/logging/Logger.h"
-#include "core/ProcessGroup.h"
-#include "FlowController.h"
-#include "HTTPIntegrationBase.h"
-#include "processors/LogAttribute.h"
-#include "utils/IntegrationTestUtils.h"
-
-constexpr uint64_t WAITTIME_MSECS = 5000;
-
-class HttpTestHarness : public IntegrationBase {
- public:
-  HttpTestHarness() : IntegrationBase(WAITTIME_MSECS) {
-    char format[] = "/tmp/ssth.XXXXXX";
-    dir = testController.createTempDirectory(format);
-  }
-
-  void testSetup() override {
-    LogTestController::getInstance().setDebug<minifi::FlowController>();
-    LogTestController::getInstance().setDebug<core::ProcessGroup>();
-    LogTestController::getInstance().setDebug<minifi::SchedulingAgent>();
-    LogTestController::getInstance().setDebug<core::ProcessContext>();
-    LogTestController::getInstance().setTrace<processors::InvokeHTTP>();
-    LogTestController::getInstance().setDebug<utils::HTTPClient>();
-    LogTestController::getInstance().setDebug<processors::ListenHTTP>();
-    LogTestController::getInstance().setDebug<processors::ListenHTTP::WriteCallback>();
-    LogTestController::getInstance().setDebug<processors::ListenHTTP::Handler>();
-    LogTestController::getInstance().setDebug<processors::LogAttribute>();
-    LogTestController::getInstance().setDebug<core::Processor>();
-    LogTestController::getInstance().setDebug<minifi::ThreadedSchedulingAgent>();
-    LogTestController::getInstance().setDebug<minifi::TimerDrivenSchedulingAgent>();
-    LogTestController::getInstance().setDebug<minifi::core::ProcessSession>();
-    std::fstream file;
-    ss << dir << "/" << "tstFile.ext";
-    file.open(ss.str(), std::ios::out);
-    file << "tempFile";
-    file.close();
-    configuration->set("nifi.flow.engine.threads", "1");
-  }
-
-  void cleanup() override {
-    std::remove(ss.str().c_str());
-    IntegrationBase::cleanup();
-  }
-
-  void runAssertions() override {
-    using org::apache::nifi::minifi::utils::verifyLogLinePresenceInPollTime;
-    assert(verifyLogLinePresenceInPollTime(std::chrono::milliseconds(wait_time_),
-      "curl performed",
-      "Size:1024 Offset:0"));
-    assert(false == verifyLogLinePresenceInPollTime(std::chrono::milliseconds(200), "Size:0 Offset:0"));
-  }
-
- protected:
-  std::string dir;
-  std::stringstream ss;
-  TestController testController;
-};
-
-int main(int argc, char **argv) {
-  const cmd_args args = parse_cmdline_args(argc, argv);
-  HttpTestHarness harness;
-  harness.setKeyDir(args.key_dir);
-  harness.run(args.test_file);
-  return 0;
-}
diff --git a/libminifi/test/resources/ThreadPoolAdjust.yml b/libminifi/test/resources/ThreadPoolAdjust.yml
deleted file mode 100644
index 602f26f..0000000
--- a/libminifi/test/resources/ThreadPoolAdjust.yml
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-Flow Controller:
-    name: MiNiFi Flow
-    id: 2438e3c8-015a-1000-79ca-83af40ec1990
-Processors:
-    - name: generate
-      id: 2438e3c8-015a-1000-79ca-83af40ec1991
-      class: org.apache.nifi.processors.standard.GenerateFlowFile
-      max concurrent tasks: 1
-      scheduling strategy: TIMER_DRIVEN
-      scheduling period: 1 sec
-      penalization period: 30 sec
-      yield period: 1 sec
-      run duration nanos: 0
-      auto-terminated relationships list:
-      Properties:
-    - name: listen
-      id: 2438e3c8-015a-1000-79ca-83af40ec1994
-      class: org.apache.nifi.processors.standard.ListenHTTP
-      max concurrent tasks: 1
-      scheduling strategy: TIMER_DRIVEN
-      scheduling period: 1 sec
-      penalization period: 30 sec
-      yield period: 1 sec
-      run duration nanos: 0
-      auto-terminated relationships list:
-      Properties:
-          Base Path: urlofchampions
-          Listening Port: 10099
-    - name: Invoke
-      id: 2438e3c8-015a-1000-79ca-83af40ec1992
-      class: org.apache.nifi.processors.standard.InvokeHTTP
-      max concurrent tasks: 1
-      scheduling strategy: TIMER_DRIVEN
-      scheduling period: 1 sec
-      penalization period: 30 sec
-      yield period: 1 sec
-      run duration nanos: 0
-      auto-terminated relationships list: 
-          - success
-      Properties:
-          HTTP Method: POST
-          Use Chunked Encoding: true
-          Content-type: text/html
-          Remote URL: http://localhost:10099/urlofchampions
-    - name: Loggit
-      id: 2438e3c8-015a-1000-79ca-83af40ec1993
-      class: org.apache.nifi.processors.standard.LogAttribute
-      max concurrent tasks: 1
-      scheduling strategy: TIMER_DRIVEN
-      scheduling period: 1 sec
-      penalization period: 30 sec
-      yield period: 1 sec
-      run duration nanos: 0
-      auto-terminated relationships list: 
-          - success
-      Properties:
-          LogLevel: debug
-
-Connections:    
-    - name: GenerateFlowFile/Invoke
-      id: 2438e3c8-015a-1000-79ca-83af40ec1997
-      source name: invoke
-      source id: 2438e3c8-015a-1000-79ca-83af40ec1991
-      source relationship name: success
-      destination name: LogAttribute
-      destination id: 2438e3c8-015a-1000-79ca-83af40ec1992
-      max work queue size: 0
-      max work queue data size: 1 MB
-      flowfile expiration: 60 sec
-    - name: Listen/Loggit
-      id: 2438e3c8-015a-1000-79ca-83af40ec1918
-      source id: 2438e3c8-015a-1000-79ca-83af40ec1994
-      destination id: 2438e3c8-015a-1000-79ca-83af40ec1993
-      source relationship name: success
-      max work queue size: 0
-      max work queue data size: 1 MB
-      flowfile expiration: 60 sec
-Remote Processing Groups:
-