Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip Flaky Java Windows Tests #1746

Merged
merged 18 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 Exception {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throws allows multiple exception types to be reported. Is there a reason why you changed the type to "Exception" instead of "InterruptedException, SkipException"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip, yeah fixed that just now

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 Exception {
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 Exception {
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 Exception {
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 Exception {
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 Exception {
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 Exception {
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 Exception {
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 Exception {
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 Exception {
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 Exception {
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 Exception {
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 Exception {
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 Exception {
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