@Test
  public void testNonColocatedRegionQueries() {
    IgnoredException.addIgnoredException("UnsupportedOperationException");
    client.invoke(new CacheSerializableRunnable("Test query on non-colocated regions on server") {
      @Override
      public void run2() throws CacheException {
        Set filter = new HashSet();
        filter.add(0);

        for (final String nonColocatedQuery : nonColocatedQueries) {
          function = new TestQueryFunction("queryFunction-1");
          QueryUsingFunctionContextDUnitTest test = new QueryUsingFunctionContextDUnitTest();
          try {
            ArrayList queryResults2 = test.runQueryOnClientUsingFunc(function,
                PartitionedRegionName1, filter, nonColocatedQuery);
            fail("Function call did not fail for query with function context");
          } catch (FunctionException e) {
            if (!(e.getCause() instanceof UnsupportedOperationException)) {
              Assert.fail("Should have received an UnsupportedOperationException but received", e);
            }
          }
        }
      }
    });

  }
Test on PR on one server only using filter.
geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java