@Override
      public void run() {
        while (true) {
          try {
            Thread.sleep(200);
          } catch (InterruptedException e) {
            e.printStackTrace();
          }
          String atsGuid = ((HiveStatement) stmt).getYarnATSGuid();
          if (atsGuid != null) {
            yarnATSGuidSet.set(true);
            System.out.println("Yarn ATS GUID: " + atsGuid);
            return;
          } else {
            yarnATSGuidSet.set(false);
            System.out.println("No Yarn ATS GUID yet");
          }
        }
      }
Test the non-null value of the Yarn ATS GUID.
We spawn 2 threads - one running the query and
the other attempting to read the ATS GUID.
We're using a dummy udf to simulate a query,
that runs for a sufficiently long time.
@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java