zjffdu commented on a change in pull request #3338: ZEPPELIN-4081. when the 
python process is killed,the task state is still running
URL: https://github.com/apache/zeppelin/pull/3338#discussion_r268203911
 
 

 ##########
 File path: 
python/src/test/java/org/apache/zeppelin/python/IPythonInterpreterTest.java
 ##########
 @@ -235,4 +238,30 @@ public void testGrpcFrameSize() throws 
InterpreterException, IOException {
     assertEquals(InterpreterResult.Code.SUCCESS, result.code());
   }
 
+  @Test
+  public void testIPythonProcessKilled() throws InterruptedException, 
TimeoutException {
+    final Waiter waiter = new Waiter();
+    Thread thread = new Thread() {
+      @Override
+      public void run() {
+        try {
+          InterpreterResult result = interpreter.interpret("import 
time\ntime.sleep(1000)",
+                  getInterpreterContext());
+          waiter.assertEquals(InterpreterResult.Code.ERROR, result.code());
 
 Review comment:
   Junit can only catch assertion fail in main thread, so here use 
concurrentunit to do unit test in multiple thread

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to