Skip to content

Commit

Permalink
Added test to try and repro bigdatagenomics#1282.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnothaft committed Nov 26, 2016
1 parent 9a6ceb3 commit 1dc5e87
Showing 1 changed file with 14 additions and 0 deletions.
Expand Up @@ -20,6 +20,7 @@ package org.bdgenomics.adam.rdd.read
import java.io.File
import java.nio.file.Files
import htsjdk.samtools.ValidationStringency
import org.apache.spark.SparkException
import org.bdgenomics.adam.models.{
RecordGroupDictionary,
ReferenceRegion,
Expand Down Expand Up @@ -708,4 +709,17 @@ class AlignmentRecordRDDSuite extends ADAMFunSuite {
val tempBam = sc.loadBam(tempPath)
assert(tempBam.rdd.count === ardd.rdd.count)
}

sparkTest("don't hang on pipe exception") {
val readsPath = testFile("small.1.sam")
val ardd = sc.loadBam(readsPath)

implicit val tFormatter = SAMInFormatter
implicit val uFormatter = new VCFOutFormatter

intercept[SparkException] {
val pipedRdd: VariantContextRDD = ardd.pipe("tee /dev/null")
val newRecords = pipedRdd.rdd.count
}
}
}

0 comments on commit 1dc5e87

Please sign in to comment.