You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ke...@apache.org on 2019/01/23 20:52:07 UTC

[beam] branch master updated: BEAM-4142 fix and enable sickbayed test case

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

kenn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 4f27f26  BEAM-4142 fix and enable sickbayed test case
     new 25b6a0a  Merge pull request #7413: [BEAM-4142] HadoopResourceIdTest has had a masked failure
4f27f26 is described below

commit 4f27f26b4c1140b6df857c2e9a723812d518f0c1
Author: Michael Luckey <25...@users.noreply.github.com>
AuthorDate: Fri Jan 4 01:21:14 2019 +0100

    BEAM-4142 fix and enable sickbayed test case
---
 .../src/main/java/org/apache/beam/sdk/io/hdfs/HadoopResourceId.java    | 3 +++
 .../test/java/org/apache/beam/sdk/io/hdfs/HadoopResourceIdTest.java    | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopResourceId.java b/sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopResourceId.java
index 54b66a7..e0e6889 100644
--- a/sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopResourceId.java
+++ b/sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopResourceId.java
@@ -18,6 +18,7 @@
 package org.apache.beam.sdk.io.hdfs;
 
 import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkArgument;
+import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkState;
 
 import java.net.URI;
 import java.util.Objects;
@@ -36,6 +37,8 @@ class HadoopResourceId implements ResourceId {
 
   @Override
   public ResourceId resolve(String other, ResolveOptions resolveOptions) {
+    checkState(
+        isDirectory(), String.format("Expected this resource is a directory, but had [%s].", uri));
     if (resolveOptions == StandardResolveOptions.RESOLVE_DIRECTORY) {
       if (!other.endsWith("/")) {
         other += "/";
diff --git a/sdks/java/io/hadoop-file-system/src/test/java/org/apache/beam/sdk/io/hdfs/HadoopResourceIdTest.java b/sdks/java/io/hadoop-file-system/src/test/java/org/apache/beam/sdk/io/hdfs/HadoopResourceIdTest.java
index 346f9ce..4d7fb8d 100644
--- a/sdks/java/io/hadoop-file-system/src/test/java/org/apache/beam/sdk/io/hdfs/HadoopResourceIdTest.java
+++ b/sdks/java/io/hadoop-file-system/src/test/java/org/apache/beam/sdk/io/hdfs/HadoopResourceIdTest.java
@@ -27,7 +27,6 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -60,7 +59,6 @@ public class HadoopResourceIdTest {
   }
 
   @Test
-  @Ignore("https://issues.apache.org/jira/browse/BEAM-4142")
   public void testResourceIdTester() {
     ResourceId baseDirectory =
         FileSystems.matchNewResource(