From issues-return-88646-archive-asf-public=cust-asf.ponee.io@nifi.apache.org Thu Nov 28 15:48:01 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 12E1A18064C for ; Thu, 28 Nov 2019 16:48:00 +0100 (CET) Received: (qmail 9588 invoked by uid 500); 28 Nov 2019 15:48:00 -0000 Mailing-List: contact issues-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list issues@nifi.apache.org Received: (qmail 9579 invoked by uid 99); 28 Nov 2019 15:48:00 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Nov 2019 15:48:00 +0000 From: GitBox To: issues@nifi.apache.org Subject: [GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #683: MINIFICPP-1087 - Proper handling of errors during onSchedule calls Message-ID: <157495608032.16065.14049141369846474113.gitbox@gitbox.apache.org> Date: Thu, 28 Nov 2019 15:48:00 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit arpadboda commented on a change in pull request #683: MINIFICPP-1087 - Proper handling of errors during onSchedule calls URL: https://github.com/apache/nifi-minifi-cpp/pull/683#discussion_r351848394 ########## File path: libminifi/test/integration/OnScheduleErrorHandlingTests.cpp ########## @@ -0,0 +1,70 @@ +/** + * @file GenerateFlowFile.h + * GenerateFlowFile class declaration + * + * 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 +#include "IntegrationBase.h" +#include "core/logging/Logger.h" +#include "../TestBase.h" +#include "../KamikazeProcessor.h" + +class OnScheduleErrorHandlingTests : public IntegrationBase { + public: + virtual void runAssertions() { + std::string logs = LogTestController::getInstance().log_output.str(); + size_t pos = 0; + unsigned int occurances = 0; + do { + pos = logs.find(minifi::processors::KamikazeProcessor::OnScheduleExceptionStr, pos); + if (pos != std::string::npos) { + pos = logs.find(minifi::processors::KamikazeProcessor::OnUnScheduleLogStr, pos); + if (pos != std::string::npos) { + occurances++; + } + } + } while (pos != std::string::npos && pos < logs.length()); Review comment: Fair point, it's just a leftover of a previous version was pos was amended as well. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services