@Override
      public void run2() throws CacheException {
        if (expectedErr != null) {
          getCache().getLogger()
              .info("<ExpectedException action=add>" + expectedErr + "</ExpectedException>");
        }
        try {
          work();
        } finally {
          if (expectedErr != null) {
            getCache().getLogger()
                .info("<ExpectedException action=remove>" + expectedErr + "</ExpectedException>");
          }
        }
      }
Execute/register CQ as running.

@param initialResults true if initialResults are requested
@param expectedResultsSize if >= 0, validate results against this size
@param expectedErr if not null, an error we expect
geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqQueryUsingPoolDUnitTest.java