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

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

                Author: ASF GitHub Bot
            Created on: 14/Feb/22 22:05
            Start Date: 14/Feb/22 22:05
    Worklog Time Spent: 10m 
      Work Description: benWize commented on a change in pull request #16609:
URL: https://github.com/apache/beam/pull/16609#discussion_r806276759



##########
File path: 
examples/java/src/test/java/org/apache/beam/examples/cookbook/MaxPerKeyExamplesIT.java
##########
@@ -0,0 +1,101 @@
+/*
+ * 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.examples.cookbook;
+
+import static org.junit.Assert.assertEquals;
+
+import com.google.api.client.util.BackOff;
+import com.google.api.client.util.BackOffUtils;
+import com.google.api.client.util.Sleeper;
+import com.google.api.services.bigquery.model.QueryResponse;
+import org.apache.beam.sdk.extensions.gcp.options.GcpOptions;
+import org.apache.beam.sdk.extensions.gcp.util.BackOffAdapter;
+import org.apache.beam.sdk.io.gcp.testing.BigqueryClient;
+import org.apache.beam.sdk.options.PipelineOptionsFactory;
+import org.apache.beam.sdk.testing.TestPipeline;
+import org.apache.beam.sdk.testing.TestPipelineOptions;
+import org.apache.beam.sdk.util.FluentBackoff;
+import org.joda.time.Duration;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+/** An end-to-end test for {@link 
org.apache.beam.examples.cookbook.MaxPerKeyExamples}. */
+@RunWith(JUnit4.class)
+public class MaxPerKeyExamplesIT {
+  private MaxPerKeyExamplesIT.MaxPerKeyExamplesOptions options;
+  private final String timestamp = Long.toString(System.currentTimeMillis());
+  private final String outputDatasetId = "max_per_key_examples" + timestamp;
+  private final String outputTable = "max_per_key_examples_table";
+  private final Long defaultExpiration = 1000L * 60 * 60;
+  private String projectId;
+  private BigqueryClient bqClient;
+
+  /** Options for the MaxPerKeyExamples Integration Test. */
+  public interface MaxPerKeyExamplesOptions
+      extends TestPipelineOptions, MaxPerKeyExamples.Options {}
+
+  @Before
+  public void setupTestEnvironment() throws Exception {
+    PipelineOptionsFactory.register(TestPipelineOptions.class);
+    this.options =
+        TestPipeline.testingPipelineOptions()
+            .as(MaxPerKeyExamplesIT.MaxPerKeyExamplesOptions.class);
+    this.projectId = 
TestPipeline.testingPipelineOptions().as(GcpOptions.class).getProject();
+    this.bqClient = new BigqueryClient("MaxPerKeyExamplesIT");
+    this.bqClient.createNewDataset(this.projectId, this.outputDatasetId, 
defaultExpiration);
+  }
+
+  @After
+  public void cleanupTestEnvironment() {
+    this.bqClient.deleteDataset(this.projectId, this.outputDatasetId);
+  }
+
+  @Test
+  public void testE2EMaxPerKeyExamples() throws Exception {
+    this.options.setOutput(
+        String.format("%s:%s.%s", this.projectId, this.outputDatasetId, 
this.outputTable));
+    MaxPerKeyExamples.runMaxPerKeyExamples(options);
+    FluentBackoff backoffFactory =
+        
FluentBackoff.DEFAULT.withMaxRetries(4).withInitialBackoff(Duration.standardSeconds(1L));

Review comment:
       I think is like 2 minutes max, the default exponent is 1.5 and the max 
retries are 4. 




-- 
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]


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

    Worklog Id:     (was: 726646)
    Time Spent: 49.5h  (was: 49h 20m)

> All beam examples should get continuously exercised on at least 2 runners
> -------------------------------------------------------------------------
>
>                 Key: BEAM-12572
>                 URL: https://issues.apache.org/jira/browse/BEAM-12572
>             Project: Beam
>          Issue Type: New Feature
>          Components: testing
>            Reporter: Valentyn Tymofieiev
>            Assignee: Benjamin Gonzalez
>            Priority: P3
>          Time Spent: 49.5h
>  Remaining Estimate: 0h
>
> Sometimes our examples become broken without us noticing. For example, see: 
> https://lists.apache.org/thread.html/r45340bbee91a6caf798fe62d24388f645f8792cc7506351fd66adec3%40%3Cdev.beam.apache.org%3E
> We should test our examples better.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to