@Test
  public void testDisabledPoll() throws MetaException, TException {
    try {
      MetastoreConf.setBoolVar(metaStore.getConf(), ConfVars.SCHEDULED_QUERIES_ENABLED, false);
      ObjectStore objStore = new ObjectStore();
      objStore.setConf(metaStore.getConf());
      thrown.expect(MetaException.class);
      thrown.expectMessage(ArgumentMatchers.contains(ConfVars.SCHEDULED_QUERIES_ENABLED.getVarname()));
      objStore.scheduledQueryPoll(new ScheduledQueryPollRequest());
    } finally {
      MetastoreConf.setBoolVar(metaStore.getConf(), ConfVars.SCHEDULED_QUERIES_ENABLED, true);
    }
  }
Simulates some schq failure scenario.

Q1 is executed correctly 1 time; but every further executions are end with failures
Q2 should be executed without without issues even thru Q1 will be disabled at some point
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestMetastoreScheduledQueries.java