@Override
      public void run2() throws CacheException {
        Region region = getRootRegion().getSubregion(name);
        String queryString = "select distinct * from " + SEPARATOR + name;
        // SelectResults results = null;
        try {
          region.query(queryString);
          fail("The query should have experienced RegionDestroyedException");
        } catch (QueryInvocationTargetException qte) {
          // Ok test passed
        } catch (Exception e) {
          Assert.fail("Failed executing query " + queryString + " due  to unexpected Excecption",
              e);
        }
      }
This the dunit test for the bug no : 36969
geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/RemoteQueryDUnitTest.java