@Test
  public void testBug36434() throws Exception {
    final String name = getName();
    final Host host = Host.getHost(0);
    VM vm0 = host.getVM(0);
    VM vm1 = host.getVM(1);

    final int numberOfEntries = 100;

    // Start server
    vm0.invoke(new CacheSerializableRunnable("Create cache server") {
      @Override
      public void run2() throws CacheException {
        Properties config = new Properties();
        config.setProperty(LOCATORS,
            "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]");
        getSystem(config);
        AttributesFactory factory = new AttributesFactory();
        factory.setScope(Scope.LOCAL);
        createRegion(name, factory.createRegionAttributes());
        try {
          startBridgeServer(0, false);
        } catch (Exception ex) {
          Assert.fail("While starting CacheServer", ex);
        }
      }
    });

    // Initialize server region
    vm0.invoke(new CacheSerializableRunnable("Create cache server") {
      @Override
      public void run2() throws CacheException {
        Region region = getRootRegion().getSubregion(name);
        for (int i = 0; i < numberOfEntries; i++) {
          region.put("key-" + i, new TestObject(i, "ibm"));
        }
      }
    });

    final int port = vm0.invoke(RemoteQueryDUnitTest::getCacheServerPort);
    final String host0 = NetworkUtils.getServerHostName(vm0.getHost());

    // Create client region in VM1
    vm1.invoke(new CacheSerializableRunnable("Create region") {
      @Override
      public void run2() throws CacheException {
        Properties config = new Properties();
        config.setProperty(MCAST_PORT, "0");
        getSystem(config);
        PoolManager.createFactory().addServer(host0, port).setSubscriptionEnabled(true)
            .create("clientPool");
        getCache();
        AttributesFactory factory = new AttributesFactory();
        factory.setScope(Scope.LOCAL);
        factory.setPoolName("clientPool");
        createRegion(name, factory.createRegionAttributes());
      }
    });


    // Execute client queries in VM1
    vm1.invoke(new CacheSerializableRunnable("Execute queries") {
      @Override
      public void run2() throws CacheException {
        Region region = getRootRegion().getSubregion(name);
        String[] queryStrings = {"id<9", "selection<9", "important<9", "\"select\"<9"};
        for (final String queryString : queryStrings) {
          SelectResults results = null;

          try {
            results = region.query(queryString);
          } catch (Exception e) {
            Assert.fail("Failed executing " + queryString, e);
          }
          assertEquals(9, results.size());
          String msg = "results expected to be instance of ResultsBag,"
              + " but was found to be is instance of '";
          assertTrue(msg + results.getClass().getName() + "'", results instanceof ResultsBag);
          assertTrue(results.asList().get(0) instanceof TestObject);
        }
      }
    });

    // Close client VM1
    vm1.invoke(new CacheSerializableRunnable("Close client") {
      @Override
      public void run2() throws CacheException {
        Region region = getRootRegion().getSubregion(name);
        region.close();
        PoolManager.find("clientPool").destroy();
      }
    });


    // Stop server
    vm0.invoke(new SerializableRunnable("Stop CacheServer") {
      @Override
      public void run() {
        stopBridgeServer(getCache());
      }
    });
  }
This the dunit test for the bug no : 36434
geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/RemoteQueryDUnitTest.java