[ 
https://issues.apache.org/jira/browse/BEAM-6334?focusedWorklogId=184900&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-184900
 ]

ASF GitHub Bot logged work on BEAM-6334:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Jan/19 17:19
            Start Date: 14/Jan/19 17:19
    Worklog Time Spent: 10m 
      Work Description: aromanenko-dev commented on pull request #7450: 
[BEAM-6334] Add throwing exception in case of invalid state or timeout
URL: https://github.com/apache/beam/pull/7450#discussion_r247578010
 
 

 ##########
 File path: 
sdks/java/testing/load-tests/src/main/java/org/apache/beam/sdk/loadtests/JobFailure.java
 ##########
 @@ -0,0 +1,87 @@
+/*
+ * 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.
+ */
+package org.apache.beam.sdk.loadtests;
+
+import static java.lang.String.format;
+import static java.util.Optional.empty;
+import static java.util.Optional.of;
+
+import java.io.IOException;
+import java.util.Optional;
+import org.apache.beam.sdk.PipelineResult;
+import org.joda.time.Duration;
+
+/** Class for detecting failures after {@link 
PipelineResult#waitUntilFinish(Duration)} unblocks. */
+class JobFailure {
+
+  private String cause;
+
+  private boolean requiresCancelling;
+
+  JobFailure(String cause, boolean requiresCancelling) {
+    this.cause = cause;
+    this.requiresCancelling = requiresCancelling;
+  }
+
+  static Optional<JobFailure> assertFailure(PipelineResult pipelineResult,
+      LoadTestResult testResult) {
+    PipelineResult.State state = pipelineResult.getState();
+
+    Optional<JobFailure> stateRelatedFailure = lookForInvalidState(state);
+
+    if (stateRelatedFailure.isPresent()) {
+      return stateRelatedFailure;
 
 Review comment:
   I'd suggest to throw an `AssertionError` based exception instead of return 
value. Otherwise, it would be better to rename the method `assertFailure` to 
avoid confusing with other `assert*`-like methods (e.g. from JUnit).
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 184900)
    Time Spent: 1h 20m  (was: 1h 10m)

> Change status of LoadTests after failure on Dataflow
> ----------------------------------------------------
>
>                 Key: BEAM-6334
>                 URL: https://issues.apache.org/jira/browse/BEAM-6334
>             Project: Beam
>          Issue Type: Bug
>          Components: testing
>            Reporter: Kasia Kucharczyk
>            Assignee: Lukasz Gajowy
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> When GroupByKey load test was tested via Jenkins and it was failing on 
> Dataflow, Jenkins was showing Success status.
> Example:
> [Jenkins build 
> link|https://builds.apache.org/view/A-D/view/Beam/view/All/job/beam_Java_LoadTests_GroupByKey_Dataflow_Small_PR/3/].



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to