Skip to content

Commit

Permalink
Merge 8584d43 into 2d9c7cc
Browse files Browse the repository at this point in the history
  • Loading branch information
msaroufim authored Jul 29, 2022
2 parents 2d9c7cc + 8584d43 commit adb69ee
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.pytorch.serve.util.JsonUtils;
import org.pytorch.serve.wlm.Model;
import org.testng.Assert;
import org.testng.SkipException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -1133,7 +1134,11 @@ public void testModelWithInvalidCustomPythonDependency()
@Test(
alwaysRun = true,
dependsOnMethods = {"testModelWithInvalidCustomPythonDependency"})
public void testLoadingMemoryError() throws InterruptedException {
public void testLoadingMemoryError() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}

Channel channel = TestUtils.connect(ConnectorType.MANAGEMENT_CONNECTOR, configManager);
Assert.assertNotNull(channel);
TestUtils.setResult(null);
Expand Down Expand Up @@ -1338,7 +1343,10 @@ public void testInvalidRootRequest() throws InterruptedException {
@Test(
alwaysRun = true,
dependsOnMethods = {"testInvalidRootRequest"})
public void testInvalidInferenceUri() throws InterruptedException {
public void testInvalidInferenceUri() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}
Channel channel = TestUtils.connect(ConnectorType.INFERENCE_CONNECTOR, configManager);
Assert.assertNotNull(channel);

Expand All @@ -1356,7 +1364,10 @@ public void testInvalidInferenceUri() throws InterruptedException {
@Test(
alwaysRun = true,
dependsOnMethods = {"testInvalidInferenceUri"})
public void testInvalidDescribeModel() throws InterruptedException {
public void testInvalidDescribeModel() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}
Channel channel = TestUtils.connect(ConnectorType.INFERENCE_CONNECTOR, configManager);
Assert.assertNotNull(channel);

Expand All @@ -1372,7 +1383,10 @@ public void testInvalidDescribeModel() throws InterruptedException {
@Test(
alwaysRun = true,
dependsOnMethods = {"testInvalidDescribeModel"})
public void testInvalidPredictionsUri() throws InterruptedException {
public void testInvalidPredictionsUri() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}
Channel channel = TestUtils.connect(ConnectorType.INFERENCE_CONNECTOR, configManager);
Assert.assertNotNull(channel);

Expand Down Expand Up @@ -1447,7 +1461,10 @@ public void testInvalidManagementUri() throws InterruptedException {
@Test(
alwaysRun = true,
dependsOnMethods = {"testInvalidManagementUri"})
public void testInvalidModelsMethod() throws InterruptedException {
public void testInvalidModelsMethod() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}
Channel channel = TestUtils.connect(ConnectorType.MANAGEMENT_CONNECTOR, configManager);
Assert.assertNotNull(channel);

Expand Down Expand Up @@ -1502,7 +1519,10 @@ public void testDescribeModelNotFound() throws InterruptedException {
@Test(
alwaysRun = true,
dependsOnMethods = {"testDescribeModelNotFound"})
public void testDescribeModelVersionNotFound() throws InterruptedException {
public void testDescribeModelVersionNotFound() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}
Channel channel = TestUtils.connect(ConnectorType.MANAGEMENT_CONNECTOR, configManager);
Assert.assertNotNull(channel);

Expand Down Expand Up @@ -1579,7 +1599,10 @@ public void testRegisterModelNotFound() throws InterruptedException {
@Test(
alwaysRun = true,
dependsOnMethods = {"testRegisterModelNotFound"})
public void testRegisterModelConflict() throws InterruptedException {
public void testRegisterModelConflict() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}
Channel channel = TestUtils.connect(ConnectorType.MANAGEMENT_CONNECTOR, configManager);
Assert.assertNotNull(channel);

Expand Down Expand Up @@ -1734,7 +1757,10 @@ public void testScaleModelVersionNotFound() throws InterruptedException {
@Test(
alwaysRun = true,
dependsOnMethods = {"testScaleModelNotFound"})
public void testUnregisterModelNotFound() throws InterruptedException {
public void testUnregisterModelNotFound() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}
Channel channel = TestUtils.connect(ConnectorType.MANAGEMENT_CONNECTOR, configManager);
Assert.assertNotNull(channel);

Expand Down Expand Up @@ -1796,7 +1822,11 @@ public void testUnregisterModelTimeout()
@Test(
alwaysRun = true,
dependsOnMethods = {"testUnregisterModelTimeout"})
public void testScaleModelFailure() throws InterruptedException {
public void testScaleModelFailure() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}

Channel channel = TestUtils.connect(ConnectorType.MANAGEMENT_CONNECTOR, configManager);
Assert.assertNotNull(channel);

Expand Down Expand Up @@ -2011,7 +2041,10 @@ public void testSetInvalidDefaultVersion() throws InterruptedException {
@Test(
alwaysRun = true,
dependsOnMethods = {"testSetInvalidDefaultVersion"})
public void testUnregisterModelFailure() throws InterruptedException {
public void testUnregisterModelFailure() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}
Channel channel = TestUtils.connect(ConnectorType.MANAGEMENT_CONNECTOR, configManager);
Assert.assertNotNull(channel);
TestUtils.setResult(null);
Expand Down
21 changes: 17 additions & 4 deletions frontend/server/src/test/java/org/pytorch/serve/WorkflowTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.pytorch.serve.workflow.messages.DescribeWorkflowResponse;
import org.pytorch.serve.workflow.messages.ListWorkflowResponse;
import org.testng.Assert;
import org.testng.SkipException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Expand Down Expand Up @@ -102,7 +103,10 @@ public void testDescribeWorkflow() throws InterruptedException {
@Test(
alwaysRun = true,
dependsOnMethods = {"testDescribeWorkflow"})
public void testWorkflowPrediction() throws InterruptedException {
public void testWorkflowPrediction() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}
Channel channel = TestUtils.getInferenceChannel(configManager);
TestUtils.setResult(null);
TestUtils.setLatch(new CountDownLatch(1));
Expand Down Expand Up @@ -233,7 +237,10 @@ public void testRegisterWorkflowConflict() throws InterruptedException {
@Test(
alwaysRun = true,
dependsOnMethods = {"testRegisterWorkflowConflict"})
public void testRegisterWorkflowMalformedUrl() throws InterruptedException {
public void testRegisterWorkflowMalformedUrl() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}
Channel channel = TestUtils.connect(ConnectorType.MANAGEMENT_CONNECTOR, configManager);
Assert.assertNotNull(channel);

Expand All @@ -255,7 +262,10 @@ public void testRegisterWorkflowMalformedUrl() throws InterruptedException {
@Test(
alwaysRun = true,
dependsOnMethods = {"testRegisterWorkflowMalformedUrl"})
public void testRegisterWorkflowConnectionFailed() throws InterruptedException {
public void testRegisterWorkflowConnectionFailed() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}
Channel channel = TestUtils.connect(ConnectorType.MANAGEMENT_CONNECTOR, configManager);
Assert.assertNotNull(channel);

Expand Down Expand Up @@ -462,7 +472,10 @@ public void testPredictionMemoryError() throws InterruptedException {
@Test(
alwaysRun = true,
dependsOnMethods = {"testPredictionMemoryError"})
public void testLoadingMemoryError() throws InterruptedException {
public void testLoadingMemoryError() throws InterruptedException, SkipException {
if (System.getProperty("os.name").startsWith("Win")) {
throw new SkipException("Test skipped on Windows");
}
Channel channel = TestUtils.connect(ConnectorType.MANAGEMENT_CONNECTOR, configManager);
Assert.assertNotNull(channel);
TestUtils.setResult(null);
Expand Down

0 comments on commit adb69ee

Please sign in to comment.