Updated hard limit MathUtils.MAXN number of samples from 11,000 to 50,000.
Instead of creating a supposed network temporary directory locally which then fails when remote nodes try to access the non-existant dir, now checking to see if they network directory is available and throwing a SkipException to bypass the test when it cannot be run. TODO: Throw similar SkipExceptions when fastas are not available. Right now instead of skipping the test or failing fast the REQUIRE_NETWORK_CONNECTION=false means that the errors popup later when the networked fastas aren't found.
This commit is contained in:
parent
b8b139841d
commit
c3c7f17d90
|
|
@ -55,7 +55,7 @@ public class MathUtils {
|
|||
private static final double JACOBIAN_LOG_TABLE_INV_STEP = 1.0 / 0.001;
|
||||
private static final double MAX_JACOBIAN_TOLERANCE = 8.0;
|
||||
private static final int JACOBIAN_LOG_TABLE_SIZE = (int) (MAX_JACOBIAN_TOLERANCE / JACOBIAN_LOG_TABLE_STEP) + 1;
|
||||
private static final int MAXN = 11000;
|
||||
private static final int MAXN = 50000;
|
||||
private static final int LOG10_CACHE_SIZE = 4 * MAXN; // we need to be able to go up to 2*(2N) when calculating some of the coefficients
|
||||
|
||||
static {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
|
|||
import org.broadinstitute.sting.utils.io.IOUtils;
|
||||
import org.testng.Assert;
|
||||
import org.testng.Reporter;
|
||||
import org.testng.SkipException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
|
@ -81,8 +82,10 @@ public abstract class BaseTest {
|
|||
public static final String hg19Chr20Intervals = intervalsLocation + "whole_exome_agilent_1.1_refseq_plus_3_boosters.Homo_sapiens_assembly19.targets.chr20.interval_list";
|
||||
|
||||
public static final boolean REQUIRE_NETWORK_CONNECTION = false;
|
||||
public static final String networkTempDir;
|
||||
public static final File networkTempDirFile;
|
||||
private static final String networkTempDirRoot = "/broad/hptmp/";
|
||||
private static final boolean networkTempDirRootExists = new File(networkTempDirRoot).exists();
|
||||
private static final String networkTempDir;
|
||||
private static final File networkTempDirFile;
|
||||
|
||||
public static final File testDirFile = new File("public/testdata/");
|
||||
public static final String testDir = testDirFile.getAbsolutePath() + "/";
|
||||
|
|
@ -105,19 +108,22 @@ public abstract class BaseTest {
|
|||
// Set the Root logger to only output warnings.
|
||||
logger.setLevel(Level.WARN);
|
||||
|
||||
if ( REQUIRE_NETWORK_CONNECTION ) {
|
||||
networkTempDirFile = IOUtils.tempDir("temp.", ".dir", new File("/broad/shptmp/" + System.getProperty("user.name")));
|
||||
if (networkTempDirRootExists) {
|
||||
networkTempDirFile = IOUtils.tempDir("temp.", ".dir", new File(networkTempDirRoot + System.getProperty("user.name")));
|
||||
networkTempDirFile.deleteOnExit();
|
||||
networkTempDir = networkTempDirFile.getAbsolutePath() + "/";
|
||||
} else {
|
||||
networkTempDir = null;
|
||||
networkTempDirFile = null;
|
||||
}
|
||||
|
||||
|
||||
if ( REQUIRE_NETWORK_CONNECTION ) {
|
||||
// find our file sources
|
||||
if (!fileExist(hg18Reference) || !fileExist(hg19Reference) || !fileExist(b36KGReference)) {
|
||||
logger.fatal("We can't locate the reference directories. Aborting!");
|
||||
throw new RuntimeException("BaseTest setup failed: unable to locate the reference directories");
|
||||
}
|
||||
} else {
|
||||
networkTempDir = null;
|
||||
networkTempDirFile = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -250,8 +256,11 @@ public abstract class BaseTest {
|
|||
* Creates a temp file that will be deleted on exit after tests are complete.
|
||||
* @param name Name of the file.
|
||||
* @return A file in the network temporary directory with name, which will be deleted after the program exits.
|
||||
* @throws SkipException when the network is not available.
|
||||
*/
|
||||
public static File createNetworkTempFile(String name) {
|
||||
public static File tryCreateNetworkTempFile(String name) {
|
||||
if (!networkTempDirRootExists)
|
||||
throw new SkipException("Network temporary directory does not exist: " + networkTempDirRoot);
|
||||
File file = new File(networkTempDirFile, name);
|
||||
file.deleteOnExit();
|
||||
return file;
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class JnaSessionIntegrationTest extends BaseTest {
|
|||
return;
|
||||
}
|
||||
|
||||
File outFile = createNetworkTempFile("JnaSessionIntegrationTest.out");
|
||||
File outFile = tryCreateNetworkTempFile("JnaSessionIntegrationTest.out");
|
||||
Session session = factory.getSession();
|
||||
session.init(null);
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ public class LibDrmaaIntegrationTest extends BaseTest {
|
|||
Memory error = new Memory(LibDrmaa.DRMAA_ERROR_STRING_BUFFER);
|
||||
int errnum;
|
||||
|
||||
File outFile = createNetworkTempFile("LibDrmaaIntegrationTest.out");
|
||||
File outFile = tryCreateNetworkTempFile("LibDrmaaIntegrationTest.out");
|
||||
|
||||
errnum = LibDrmaa.drmaa_init(null, error, LibDrmaa.DRMAA_ERROR_STRING_BUFFER_LEN);
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class LibBatIntegrationTest extends BaseTest {
|
|||
@Test
|
||||
public void testSubmitEcho() throws Exception {
|
||||
String queue = "hour";
|
||||
File outFile = createNetworkTempFile("LibBatIntegrationTest.out");
|
||||
File outFile = tryCreateNetworkTempFile("LibBatIntegrationTest.out");
|
||||
|
||||
submit req = new submit();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue