Removed LibBat.SUB2_BSUB_BLOCK since the use of it exits the JVM.
Fixed integration tests to wait on their own for the job to run instead of using SUB2_BSUB_BLOCK. Updated VariantRecalibrationIntegrationTests MD5s which were knocked out of sync whele SUB2_BSUB_BLOCK was exiting in the middle of integration tests. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4840 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
67c07d1a6a
commit
01323447c6
|
|
@ -4477,7 +4477,7 @@ public class LibBat {
|
||||||
*/
|
*/
|
||||||
public static final int SUB2_MODIFY_CMD = 0x02;
|
public static final int SUB2_MODIFY_CMD = 0x02;
|
||||||
|
|
||||||
/**
|
/**//* Removed access to SUB2_BSUB_BLOCK since it exits the process (including the JVM) with the exit code of the submitted job. -kshakir December 14, 2010
|
||||||
* < Submit a job in a synchronous
|
* < Submit a job in a synchronous
|
||||||
* mode so that submission does not return until the job terminates.
|
* mode so that submission does not return until the job terminates.
|
||||||
* Note once this flag is set, the \ref lsb_submit will never return if
|
* Note once this flag is set, the \ref lsb_submit will never return if
|
||||||
|
|
@ -4486,7 +4486,7 @@ public class LibBat {
|
||||||
* API call in the blocking mode and the parent process wait on the
|
* API call in the blocking mode and the parent process wait on the
|
||||||
* child process (see wait() for details.
|
* child process (see wait() for details.
|
||||||
*/
|
*/
|
||||||
public static final int SUB2_BSUB_BLOCK = 0x04;
|
//public static final int SUB2_BSUB_BLOCK = 0x04;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* < Submit from NT.
|
* < Submit from NT.
|
||||||
|
|
|
||||||
|
|
@ -30,15 +30,15 @@ public class VariantRecalibrationWalkersIntegrationTest extends WalkerTest {
|
||||||
|
|
||||||
VRTest yriTrio = new VRTest("yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.vcf",
|
VRTest yriTrio = new VRTest("yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.vcf",
|
||||||
"4eeffa7a1965ce0c25c5edd0bae76290", // in vcf
|
"4eeffa7a1965ce0c25c5edd0bae76290", // in vcf
|
||||||
"7407987a0148284ed910e1858116dd8d", // tranches
|
"a04e00d00c991d76900634376bc1a9d1", // tranches
|
||||||
"f34b36c1da8bcb080a584592d1f6dae7", // recalVCF
|
"f34b36c1da8bcb080a584592d1f6dae7", // recalVCF
|
||||||
"1296ebde7dd61c1c58c11b07b31fd61b"); // cut VCF
|
"ee07ff6c0ff6108e00b131ce3c7a7f65"); // cut VCF
|
||||||
|
|
||||||
VRTest lowPass = new VRTest("lowpass.N3.chr1.raw.vcf",
|
VRTest lowPass = new VRTest("lowpass.N3.chr1.raw.vcf",
|
||||||
"8937a3ae7f176dacf47b8ee6c0023416", // in vcf
|
"8937a3ae7f176dacf47b8ee6c0023416", // in vcf
|
||||||
"2896657b5c30bfd8e82e62e58d94ef4e", // tranches
|
"8da48dec888c9d4e3c3c7ed7943c0c61", // tranches
|
||||||
"ae6a1e0874c966312e891b5a3c47b0e3", // recalVCF
|
"ae6a1e0874c966312e891b5a3c47b0e3", // recalVCF
|
||||||
"5eed2030d513fae05e45468fa0bb1538"); // cut VCF
|
"3ac16abdc5bbd5148f0cf88e8a7af3c9"); // cut VCF
|
||||||
|
|
||||||
@DataProvider(name = "VRTest")
|
@DataProvider(name = "VRTest")
|
||||||
public Object[][] createData1() {
|
public Object[][] createData1() {
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
package org.broadinstitute.sting.jna.lsf.v7_0_6;
|
package org.broadinstitute.sting.jna.lsf.v7_0_6;
|
||||||
|
|
||||||
|
import com.sun.jna.ptr.IntByReference;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.testng.Assert;
|
import org.testng.Assert;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
@ -36,15 +37,15 @@ import java.io.File;
|
||||||
* Really a unit test, but this test will only run on systems with LSF setup.
|
* Really a unit test, but this test will only run on systems with LSF setup.
|
||||||
*/
|
*/
|
||||||
public class LibBatIntegrationTest extends BaseTest {
|
public class LibBatIntegrationTest extends BaseTest {
|
||||||
@Test(enabled=false)
|
@Test
|
||||||
public void testClusterName() {
|
public void testClusterName() {
|
||||||
String clusterName = LibLsf.ls_getclustername();
|
String clusterName = LibLsf.ls_getclustername();
|
||||||
System.out.println("Cluster name: " + clusterName);
|
System.out.println("Cluster name: " + clusterName);
|
||||||
Assert.assertNotNull(clusterName);
|
Assert.assertNotNull(clusterName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(enabled=false)
|
@Test
|
||||||
public void testSubmitEcho() {
|
public void testSubmitEcho() throws InterruptedException {
|
||||||
String queue = "hour";
|
String queue = "hour";
|
||||||
File outFile = new File("LibBatIntegrationTest.out");
|
File outFile = new File("LibBatIntegrationTest.out");
|
||||||
|
|
||||||
|
|
@ -65,14 +66,41 @@ public class LibBatIntegrationTest extends BaseTest {
|
||||||
req.options |= LibBat.SUB_OUT_FILE;
|
req.options |= LibBat.SUB_OUT_FILE;
|
||||||
|
|
||||||
req.command = "echo \"Hello world.\"";
|
req.command = "echo \"Hello world.\"";
|
||||||
req.options2 |= LibBat.SUB2_BSUB_BLOCK;
|
|
||||||
|
|
||||||
submitReply reply = new submitReply();
|
submitReply reply = new submitReply();
|
||||||
long jobId = LibBat.lsb_submit(req, reply);
|
long jobId = LibBat.lsb_submit(req, reply);
|
||||||
|
|
||||||
Assert.assertFalse(jobId < 0, LibBat.lsb_sperror("Error dispatching"));
|
Assert.assertFalse(jobId < 0, LibBat.lsb_sperror("Error dispatching"));
|
||||||
|
|
||||||
|
System.out.println("Waiting for job to run: " + jobId);
|
||||||
|
int jobStatus = LibBat.JOB_STAT_PEND;
|
||||||
|
while (isSet(jobStatus, LibBat.JOB_STAT_PEND) || isSet(jobStatus, LibBat.JOB_STAT_RUN)) {
|
||||||
|
Thread.sleep(30 * 1000L);
|
||||||
|
|
||||||
|
int numJobs = LibBat.lsb_openjobinfo(jobId, null, null, null, null, LibBat.ALL_JOB);
|
||||||
|
try {
|
||||||
|
Assert.assertEquals(numJobs, 1);
|
||||||
|
|
||||||
|
IntByReference more = new IntByReference();
|
||||||
|
|
||||||
|
jobInfoEnt jobInfo = LibBat.lsb_readjobinfo(more);
|
||||||
|
Assert.assertNotNull(jobInfo, "Job info is null");
|
||||||
|
Assert.assertEquals(more.getValue(), 0, "More job info results than expected");
|
||||||
|
|
||||||
|
jobStatus = jobInfo.status;
|
||||||
|
} finally {
|
||||||
|
LibBat.lsb_closejobinfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Assert.assertTrue(isSet(jobStatus, LibBat.JOB_STAT_DONE), String.format("Unexpected job status: 0x%02x", jobStatus));
|
||||||
|
|
||||||
Assert.assertTrue(FileUtils.waitFor(outFile, 120), "File not found: " + outFile.getAbsolutePath());
|
Assert.assertTrue(FileUtils.waitFor(outFile, 120), "File not found: " + outFile.getAbsolutePath());
|
||||||
Assert.assertTrue(outFile.delete(), "Unable to delete " + outFile.getAbsolutePath());
|
Assert.assertTrue(outFile.delete(), "Unable to delete " + outFile.getAbsolutePath());
|
||||||
Assert.assertEquals(reply.queue, req.queue, "LSF reply queue does not match requested queue.");
|
Assert.assertEquals(reply.queue, req.queue, "LSF reply queue does not match requested queue.");
|
||||||
|
System.out.println("Validating that we reached the end of the test without exit.");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isSet(int value, int flag) {
|
||||||
|
return ((value & flag) == flag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue