Skip to content

Commit e503b8c

Browse files
committed
Improve the test to ensure we aren't masking the underlying exception
1 parent ae0b7a7 commit e503b8c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/src/test/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriterSuite.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,14 @@ public void doNotNeedToCallWriteBeforeUnsuccessfulStop() throws IOException {
253253
createWriter(false).stop(false);
254254
}
255255

256-
@Test(expected=RuntimeException.class)
256+
class PandaException extends RuntimeException {
257+
}
258+
259+
@Test(expected=PandaException.class)
257260
public void writeFailurePropegates() throws Exception {
258261
class BadRecords extends scala.collection.AbstractIterator<Product2<Object, Object>> {
259262
@Override public boolean hasNext() {
260-
throw new RuntimeException("panda magic");
263+
throw new PandaException();
261264
}
262265
@Override public Product2<Object, Object> next() {
263266
return null;

0 commit comments

Comments
 (0)