InterpreterWrapper { public PythonRequestResponse<Void> runCommands(long windowId, long requestId, PythonInterpreterRequest<Void> request) throws InterruptedException { request.setCommandType(PythonCommandType.GENERIC_COMMANDS); PythonRequestResponse requestResponse = buildRequestRespObject(request,windowId,requestId); return processRequest(requestResponse,request); } InterpreterWrapper(String interpreterId,BlockingQueue<PythonRequestResponse> delayedResponsesQueueRef,
      SpinPolicy spinPolicyForWaitingInRequestQueue); void preInitInterpreter(Map<PythonInterpreterConfig, Object> preInitConfigs); void startInterpreter(); PythonRequestResponse<T> processRequest(PythonRequestResponse requestResponse,
      PythonInterpreterRequest<T> req); PythonRequestResponse<Void> runCommands(long windowId, long requestId,
      PythonInterpreterRequest<Void> request); PythonRequestResponse<T> executeMethodCall(long windowId, long requestId,
      PythonInterpreterRequest<T> request); PythonRequestResponse<Void> executeScript(long windowId,long requestId,PythonInterpreterRequest<Void> request); PythonRequestResponse<T> eval(long windowId, long requestId,PythonInterpreterRequest<T> request); void stopInterpreter(); InterpreterThread getInterpreterThread(); void setInterpreterThread(InterpreterThread interpreterThread); SpinPolicy getCpuSpinPolicyForWaitingInBuffer(); void setCpuSpinPolicyForWaitingInBuffer(SpinPolicy cpuSpinPolicyForWaitingInBuffer); int getBufferCapacity(); void setBufferCapacity(int bufferCapacity); String getInterpreterId(); void setInterpreterId(String interpreterId); BlockingQueue<PythonRequestResponse> getRequestQueue(); void setRequestQueue(BlockingQueue<PythonRequestResponse> requestQueue); BlockingQueue<PythonRequestResponse> getResponseQueue(); void setResponseQueue(BlockingQueue<PythonRequestResponse> responseQueue); BlockingQueue<PythonRequestResponse> getDelayedResponsesQueue(); void setDelayedResponsesQueue(BlockingQueue<PythonRequestResponse> delayedResponsesQueue); boolean isCurrentlyBusy();  }
@JepPythonTestContext(jepPythonBasedTest = true) @Test public void testTimeOuts() throws Exception { List<String> sequenceOfCommands = new ArrayList(); sequenceOfCommands.add("import time"); sequenceOfCommands.add("time.sleep(1)"); PythonInterpreterRequest<Void> requestOne = buildRequestObjectForVoidGenericCommand( sequenceOfCommands,3,TimeUnit.SECONDS); PythonRequestResponse<Void> resultOne = interpreterWrapper.runCommands(1L,1L, requestOne); assertNotNull(resultOne); requestOne.setTimeUnit(TimeUnit.MILLISECONDS); requestOne.setTimeout(5); PythonRequestResponse<Void> resultTWo = interpreterWrapper.runCommands(1L,1L,requestOne); assertNull(resultTWo); }