aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@databricks.com>2015-05-14 23:17:41 -0700
committerJosh Rosen <joshrosen@databricks.com>2015-05-14 23:17:41 -0700
commit7da33ce5057ff965eec19ce662465b64a3564019 (patch)
treeac1fbf5cfeea35c37e3828e1b8c8d7ccb3752a10
parente8f0e016eaf80a363796dd0a094291dcb3b35793 (diff)
downloadspark-7da33ce5057ff965eec19ce662465b64a3564019.tar.gz
spark-7da33ce5057ff965eec19ce662465b64a3564019.tar.bz2
spark-7da33ce5057ff965eec19ce662465b64a3564019.zip
[HOTFIX] Add workaround for SPARK-7660 to fix JavaAPISuite failures.
-rw-r--r--core/src/test/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriterSuite.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/src/test/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriterSuite.java b/core/src/test/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriterSuite.java
index 730d265c87..78e5264353 100644
--- a/core/src/test/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriterSuite.java
+++ b/core/src/test/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriterSuite.java
@@ -35,6 +35,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
+import org.xerial.snappy.buffer.CachedBufferAllocator;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.lessThan;
@@ -96,6 +97,13 @@ public class UnsafeShuffleWriterSuite {
@After
public void tearDown() {
Utils.deleteRecursively(tempDir);
+ // This call is a workaround for SPARK-7660, a snappy-java bug which is exposed by this test
+ // suite. Clearing the cached buffer allocator's pool of reusable buffers masks this bug,
+ // preventing a test failure in JavaAPISuite that would otherwise occur. The underlying bug
+ // needs to be fixed, but in the meantime this workaround avoids spurious Jenkins failures.
+ synchronized (CachedBufferAllocator.class) {
+ CachedBufferAllocator.queueTable.clear();
+ }
final long leakedMemory = taskMemoryManager.cleanUpAllAllocatedMemory();
if (leakedMemory != 0) {
fail("Test leaked " + leakedMemory + " bytes of managed memory");