File tree 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
9 files changed +102
-10
lines changed Original file line number Diff line number Diff line change 22
22
import static org .junit .jupiter .api .Assertions .assertNotNull ;
23
23
import static org .junit .jupiter .api .Assertions .assertTrue ;
24
24
import static org .junit .jupiter .api .Assertions .fail ;
25
+ import static org .junit .jupiter .api .Assumptions .assumeTrue ;
25
26
26
27
import javax .ws .rs .client .Client ;
27
28
import javax .ws .rs .client .ClientBuilder ;
@@ -57,7 +58,16 @@ public static void setup() throws Exception {
57
58
util = new HBaseTestingUtility ();
58
59
Configuration conf = util .getConfiguration ();
59
60
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
+ }
61
71
DataGeneratorForTest .createSchema (util .getConfiguration ());
62
72
}
63
73
Original file line number Diff line number Diff line change 22
22
import static org .junit .jupiter .api .Assertions .assertNotNull ;
23
23
import static org .junit .jupiter .api .Assertions .assertTrue ;
24
24
import static org .junit .jupiter .api .Assertions .fail ;
25
+ import static org .junit .jupiter .api .Assumptions .assumeTrue ;
25
26
26
27
import java .io .IOException ;
27
28
import java .util .Arrays ;
@@ -95,7 +96,16 @@ public class TestHBaseTimelineStorageApps {
95
96
@ BeforeAll
96
97
public static void setupBeforeClass () throws Exception {
97
98
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
+ }
99
109
DataGeneratorForTest .createSchema (util .getConfiguration ());
100
110
DataGeneratorForTest .loadApps (util , CURRENT_TIME );
101
111
}
Original file line number Diff line number Diff line change 39
39
import static org .junit .jupiter .api .Assertions .assertEquals ;
40
40
import static org .junit .jupiter .api .Assertions .assertNotNull ;
41
41
import static org .junit .jupiter .api .Assertions .assertTrue ;
42
+ import static org .junit .jupiter .api .Assumptions .assumeTrue ;
42
43
43
44
/**
44
45
* Test for timeline domain.
@@ -52,7 +53,16 @@ public static void setupBeforeClass() throws Exception {
52
53
util = new HBaseTestingUtility ();
53
54
Configuration conf = util .getConfiguration ();
54
55
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
+ }
56
66
DataGeneratorForTest .createSchema (util .getConfiguration ());
57
67
}
58
68
Original file line number Diff line number Diff line change 23
23
import static org .junit .jupiter .api .Assertions .assertNull ;
24
24
import static org .junit .jupiter .api .Assertions .assertTrue ;
25
25
import static org .junit .jupiter .api .Assertions .fail ;
26
+ import static org .junit .jupiter .api .Assumptions .assumeTrue ;
26
27
27
28
import java .io .IOException ;
28
29
import java .util .Arrays ;
@@ -109,7 +110,16 @@ public class TestHBaseTimelineStorageEntities {
109
110
@ BeforeAll
110
111
public static void setupBeforeClass () throws Exception {
111
112
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
+ }
113
123
DataGeneratorForTest .createSchema (util .getConfiguration ());
114
124
DataGeneratorForTest .loadEntities (util , CURRENT_TIME );
115
125
}
Original file line number Diff line number Diff line change 20
20
21
21
import static org .junit .jupiter .api .Assertions .assertNotNull ;
22
22
import static org .junit .jupiter .api .Assertions .assertTrue ;
23
+ import static org .junit .jupiter .api .Assumptions .assumeTrue ;
23
24
24
25
import org .apache .hadoop .yarn .server .timelineservice .storage .common .BaseTableRW ;
25
26
import org .apache .hadoop .yarn .server .timelineservice .storage .entity .EntityTableRW ;
@@ -50,7 +51,16 @@ public static void setupBeforeClass() throws Exception {
50
51
util = new HBaseTestingUtility ();
51
52
Configuration conf = util .getConfiguration ();
52
53
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
+ }
54
64
}
55
65
56
66
@ Test
@@ -142,7 +152,11 @@ public void createWithSetPrefix() throws IOException {
142
152
@ AfterAll
143
153
public static void tearDownAfterClass () throws Exception {
144
154
if (util != null ) {
145
- util .shutdownMiniCluster ();
155
+ try {
156
+ util .shutdownMiniCluster ();
157
+ } catch (Exception e ) {
158
+ //May not work if we failed initializing
159
+ }
146
160
}
147
161
}
148
162
}
Original file line number Diff line number Diff line change 33
33
import static org .apache .hadoop .yarn .conf .YarnConfiguration .TIMELINE_SERVICE_READER_STORAGE_MONITOR_INTERVAL_MS ;
34
34
import static org .junit .jupiter .api .Assertions .assertTrue ;
35
35
import static org .junit .jupiter .api .Assertions .fail ;
36
+ import static org .junit .jupiter .api .Assumptions .assumeTrue ;
36
37
37
38
/**
38
- * This class tests HbaseTimelineWriter with Hbase Down.
39
+ * This class tests HbaseTimelineWriter with HBase Down.
39
40
*/
40
41
public class TestTimelineWriterHBaseDown {
41
42
@@ -86,6 +87,13 @@ public void testTimelineWriterHBaseDown() throws Exception {
86
87
}
87
88
assertTrue (
88
89
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
+ }
89
97
} finally {
90
98
writer .stop ();
91
99
util .shutdownMiniCluster ();
Original file line number Diff line number Diff line change 22
22
import static org .junit .jupiter .api .Assertions .assertNotNull ;
23
23
import static org .junit .jupiter .api .Assertions .assertTrue ;
24
24
import static org .junit .jupiter .api .Assertions .fail ;
25
+ import static org .junit .jupiter .api .Assumptions .assumeTrue ;
25
26
26
27
import java .io .IOException ;
27
28
import java .util .Map ;
@@ -71,7 +72,16 @@ public static void setupBeforeClass() throws Exception {
71
72
util = new HBaseTestingUtility ();
72
73
Configuration conf = util .getConfiguration ();
73
74
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
+ }
75
85
DataGeneratorForTest .createSchema (util .getConfiguration ());
76
86
}
77
87
Original file line number Diff line number Diff line change 22
22
import static org .junit .jupiter .api .Assertions .assertNotNull ;
23
23
import static org .junit .jupiter .api .Assertions .assertTrue ;
24
24
import static org .junit .jupiter .api .Assertions .fail ;
25
+ import static org .junit .jupiter .api .Assumptions .assumeTrue ;
25
26
26
27
import java .io .IOException ;
27
28
import java .util .EnumSet ;
@@ -83,7 +84,16 @@ public static void setupBeforeClass() throws Exception {
83
84
util = new HBaseTestingUtility ();
84
85
Configuration conf = util .getConfiguration ();
85
86
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
+ }
87
97
DataGeneratorForTest .createSchema (util .getConfiguration ());
88
98
}
89
99
Original file line number Diff line number Diff line change 24
24
import static org .junit .jupiter .api .Assertions .assertNotEquals ;
25
25
import static org .junit .jupiter .api .Assertions .assertTrue ;
26
26
import static org .junit .jupiter .api .Assertions .fail ;
27
+ import static org .junit .jupiter .api .Assumptions .assumeTrue ;
27
28
28
29
import java .io .IOException ;
29
30
import java .util .ArrayList ;
@@ -83,7 +84,16 @@ public static void setupBeforeClass() throws Exception {
83
84
util = new HBaseTestingUtility ();
84
85
Configuration conf = util .getConfiguration ();
85
86
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
+ }
87
97
DataGeneratorForTest .createSchema (util .getConfiguration ());
88
98
}
89
99
You can’t perform that action at this time.
0 commit comments