private String getEnv(String envName, InterpreterLaunchContext context) {
    String env = context.getProperties().getProperty(envName);
    if (StringUtils.isBlank(env)) {
      env = System.getenv(envName);
    }
    if (StringUtils.isBlank(env)) {
      LOGGER.warn("environment variable: {} is empty", envName);
    }

    return env;
  }
@Test
  void testConnectTimeOut() throws IOException {
    SparkInterpreterLauncher launcher = new SparkInterpreterLauncher(zConf, null);
    Properties properties = new Properties();
    properties.setProperty("SPARK_HOME", sparkHome);
    properties.setProperty(
        ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_CONNECT_TIMEOUT.getVarName(), "10000");
    InterpreterOption option = new InterpreterOption();
    option.setUserImpersonate(true);
    InterpreterLaunchContext context = new InterpreterLaunchContext(properties, option, null, "user1", "intpGroupId", "groupId", "groupName", "name", 0, "host");
    InterpreterClient client = launcher.launch(context);
    assertTrue(client instanceof ExecRemoteInterpreterProcess);
    try (ExecRemoteInterpreterProcess interpreterProcess = (ExecRemoteInterpreterProcess) client) {
      assertEquals("name", interpreterProcess.getInterpreterSettingName());
      assertEquals(zeppelinHome + "/interpreter/groupName", interpreterProcess.getInterpreterDir());
      assertEquals(zeppelinHome + "/local-repo/groupId", interpreterProcess.getLocalRepoDir());
      assertEquals(10000, interpreterProcess.getConnectTimeout());
      assertEquals(zConf.getInterpreterRemoteRunnerPath(), interpreterProcess.getInterpreterRunner());
      assertTrue(interpreterProcess.getEnv().size() >= 2);
      assertEquals(true, interpreterProcess.isUserImpersonated());
    }
  }