Skip to content

Commit 3a425a3

Browse files
committed
YARN-11807. Skip each test in hadoop-yarn-server-timelineservice-hbase-tests when InaccessibleObjectException is thrown
1 parent 32929eb commit 3a425a3

File tree

9 files changed

+102
-10
lines changed

9 files changed

+102
-10
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/AbstractTimelineReaderHBaseTestBase.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import static org.junit.jupiter.api.Assertions.assertNotNull;
2323
import static org.junit.jupiter.api.Assertions.assertTrue;
2424
import static org.junit.jupiter.api.Assertions.fail;
25+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
2526

2627
import javax.ws.rs.client.Client;
2728
import javax.ws.rs.client.ClientBuilder;
@@ -57,7 +58,16 @@ public static void setup() throws Exception {
5758
util = new HBaseTestingUtility();
5859
Configuration conf = util.getConfiguration();
5960
conf.setInt("hfile.format.version", 3);
60-
util.startMiniCluster();
61+
try {
62+
util.startMiniCluster();
63+
} catch (Exception e) {
64+
// TODO catch InaccessibleObjectException directly once Java 8 support is dropped
65+
if (e.getClass().getSimpleName().equals("InaccessibleObjectException")) {
66+
assumeTrue(false, "Could not start HBase because of HBASE-29234");
67+
} else {
68+
throw e;
69+
}
70+
}
6171
DataGeneratorForTest.createSchema(util.getConfiguration());
6272
}
6373

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/TestHBaseTimelineStorageApps.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import static org.junit.jupiter.api.Assertions.assertNotNull;
2323
import static org.junit.jupiter.api.Assertions.assertTrue;
2424
import static org.junit.jupiter.api.Assertions.fail;
25+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
2526

2627
import java.io.IOException;
2728
import java.util.Arrays;
@@ -95,7 +96,16 @@ public class TestHBaseTimelineStorageApps {
9596
@BeforeAll
9697
public static void setupBeforeClass() throws Exception {
9798
util = new HBaseTestingUtility();
98-
util.startMiniCluster();
99+
try {
100+
util.startMiniCluster();
101+
} catch (Exception e) {
102+
// TODO catch InaccessibleObjectException directly once Java 8 support is dropped
103+
if (e.getClass().getSimpleName().equals("InaccessibleObjectException")) {
104+
assumeTrue(false, "Could not start HBase because of HBASE-29234");
105+
} else {
106+
throw e;
107+
}
108+
}
99109
DataGeneratorForTest.createSchema(util.getConfiguration());
100110
DataGeneratorForTest.loadApps(util, CURRENT_TIME);
101111
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/TestHBaseTimelineStorageDomain.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import static org.junit.jupiter.api.Assertions.assertEquals;
4040
import static org.junit.jupiter.api.Assertions.assertNotNull;
4141
import static org.junit.jupiter.api.Assertions.assertTrue;
42+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
4243

4344
/**
4445
* Test for timeline domain.
@@ -52,7 +53,16 @@ public static void setupBeforeClass() throws Exception {
5253
util = new HBaseTestingUtility();
5354
Configuration conf = util.getConfiguration();
5455
conf.setInt("hfile.format.version", 3);
55-
util.startMiniCluster();
56+
try {
57+
util.startMiniCluster();
58+
} catch (Exception e) {
59+
// TODO catch InaccessibleObjectException directly once Java 8 support is dropped
60+
if (e.getClass().getSimpleName().equals("InaccessibleObjectException")) {
61+
assumeTrue(false, "Could not start HBase because of HBASE-29234");
62+
} else {
63+
throw e;
64+
}
65+
}
5666
DataGeneratorForTest.createSchema(util.getConfiguration());
5767
}
5868

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/TestHBaseTimelineStorageEntities.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import static org.junit.jupiter.api.Assertions.assertNull;
2424
import static org.junit.jupiter.api.Assertions.assertTrue;
2525
import static org.junit.jupiter.api.Assertions.fail;
26+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
2627

2728
import java.io.IOException;
2829
import java.util.Arrays;
@@ -109,7 +110,16 @@ public class TestHBaseTimelineStorageEntities {
109110
@BeforeAll
110111
public static void setupBeforeClass() throws Exception {
111112
util = new HBaseTestingUtility();
112-
util.startMiniCluster();
113+
try {
114+
util.startMiniCluster();
115+
} catch (Exception e) {
116+
// TODO catch InaccessibleObjectException directly once Java 8 support is dropped
117+
if (e.getClass().getSimpleName().equals("InaccessibleObjectException")) {
118+
assumeTrue(false, "Could not start HBase because of HBASE-29234");
119+
} else {
120+
throw e;
121+
}
122+
}
113123
DataGeneratorForTest.createSchema(util.getConfiguration());
114124
DataGeneratorForTest.loadEntities(util, CURRENT_TIME);
115125
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/TestHBaseTimelineStorageSchema.java

+16-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import static org.junit.jupiter.api.Assertions.assertNotNull;
2222
import static org.junit.jupiter.api.Assertions.assertTrue;
23+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
2324

2425
import org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTableRW;
2526
import org.apache.hadoop.yarn.server.timelineservice.storage.entity.EntityTableRW;
@@ -50,7 +51,16 @@ public static void setupBeforeClass() throws Exception {
5051
util = new HBaseTestingUtility();
5152
Configuration conf = util.getConfiguration();
5253
conf.setInt("hfile.format.version", 3);
53-
util.startMiniCluster();
54+
try {
55+
util.startMiniCluster();
56+
} catch (Exception e) {
57+
// TODO catch InaccessibleObjectException directly once Java 8 support is dropped
58+
if (e.getClass().getSimpleName().equals("InaccessibleObjectException")) {
59+
assumeTrue(false, "Could not start HBase because of HBASE-29234");
60+
} else {
61+
throw e;
62+
}
63+
}
5464
}
5565

5666
@Test
@@ -142,7 +152,11 @@ public void createWithSetPrefix() throws IOException {
142152
@AfterAll
143153
public static void tearDownAfterClass() throws Exception {
144154
if (util != null) {
145-
util.shutdownMiniCluster();
155+
try {
156+
util.shutdownMiniCluster();
157+
} catch (Exception e) {
158+
//May not work if we failed initializing
159+
}
146160
}
147161
}
148162
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/TestTimelineWriterHBaseDown.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333
import static org.apache.hadoop.yarn.conf.YarnConfiguration.TIMELINE_SERVICE_READER_STORAGE_MONITOR_INTERVAL_MS;
3434
import static org.junit.jupiter.api.Assertions.assertTrue;
3535
import static org.junit.jupiter.api.Assertions.fail;
36+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
3637

3738
/**
38-
* This class tests HbaseTimelineWriter with Hbase Down.
39+
* This class tests HbaseTimelineWriter with HBase Down.
3940
*/
4041
public class TestTimelineWriterHBaseDown {
4142

@@ -86,6 +87,13 @@ public void testTimelineWriterHBaseDown() throws Exception {
8687
}
8788
assertTrue(
8889
exceptionCaught, "HBaseStorageMonitor failed to detect HBase Down");
90+
} catch (Exception e) {
91+
// TODO catch InaccessibleObjectException directly once Java 8 support is dropped
92+
if (e.getClass().getSimpleName().equals("InaccessibleObjectException")) {
93+
assumeTrue(false, "Could not start HBase because of HBASE-29234");
94+
} else {
95+
throw e;
96+
}
8997
} finally {
9098
writer.stop();
9199
util.shutdownMiniCluster();

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/flow/TestHBaseStorageFlowActivity.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import static org.junit.jupiter.api.Assertions.assertNotNull;
2323
import static org.junit.jupiter.api.Assertions.assertTrue;
2424
import static org.junit.jupiter.api.Assertions.fail;
25+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
2526

2627
import java.io.IOException;
2728
import java.util.Map;
@@ -71,7 +72,16 @@ public static void setupBeforeClass() throws Exception {
7172
util = new HBaseTestingUtility();
7273
Configuration conf = util.getConfiguration();
7374
conf.setInt("hfile.format.version", 3);
74-
util.startMiniCluster();
75+
try {
76+
util.startMiniCluster();
77+
} catch (Exception e) {
78+
// TODO catch InaccessibleObjectException directly once Java 8 support is dropped
79+
if (e.getClass().getSimpleName().equals("InaccessibleObjectException")) {
80+
assumeTrue(false, "Could not start HBase because of HBASE-29234");
81+
} else {
82+
throw e;
83+
}
84+
}
7585
DataGeneratorForTest.createSchema(util.getConfiguration());
7686
}
7787

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/flow/TestHBaseStorageFlowRun.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import static org.junit.jupiter.api.Assertions.assertNotNull;
2323
import static org.junit.jupiter.api.Assertions.assertTrue;
2424
import static org.junit.jupiter.api.Assertions.fail;
25+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
2526

2627
import java.io.IOException;
2728
import java.util.EnumSet;
@@ -83,7 +84,16 @@ public static void setupBeforeClass() throws Exception {
8384
util = new HBaseTestingUtility();
8485
Configuration conf = util.getConfiguration();
8586
conf.setInt("hfile.format.version", 3);
86-
util.startMiniCluster();
87+
try {
88+
util.startMiniCluster();
89+
} catch (Exception e) {
90+
// TODO catch InaccessibleObjectException directly once Java 8 support is dropped
91+
if (e.getClass().getSimpleName().equals("InaccessibleObjectException")) {
92+
assumeTrue(false, "Could not start HBase because of HBASE-29234");
93+
} else {
94+
throw e;
95+
}
96+
}
8797
DataGeneratorForTest.createSchema(util.getConfiguration());
8898
}
8999

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase-tests/src/test/java/org/apache/hadoop/yarn/server/timelineservice/storage/flow/TestHBaseStorageFlowRunCompaction.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import static org.junit.jupiter.api.Assertions.assertNotEquals;
2525
import static org.junit.jupiter.api.Assertions.assertTrue;
2626
import static org.junit.jupiter.api.Assertions.fail;
27+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
2728

2829
import java.io.IOException;
2930
import java.util.ArrayList;
@@ -83,7 +84,16 @@ public static void setupBeforeClass() throws Exception {
8384
util = new HBaseTestingUtility();
8485
Configuration conf = util.getConfiguration();
8586
conf.setInt("hfile.format.version", 3);
86-
util.startMiniCluster();
87+
try {
88+
util.startMiniCluster();
89+
} catch (Exception e) {
90+
// TODO catch InaccessibleObjectException directly once Java 8 support is dropped
91+
if (e.getClass().getSimpleName().equals("InaccessibleObjectException")) {
92+
assumeTrue(false, "Could not start HBase because of HBASE-29234");
93+
} else {
94+
throw e;
95+
}
96+
}
8797
DataGeneratorForTest.createSchema(util.getConfiguration());
8898
}
8999

0 commit comments

Comments
 (0)