@Override
      public void goingToFlush() {
        synchronized (this) {

          if (!callOnce) {
            try {
              region.put("1", "2");
            } catch (Exception e) {
              logWriter.error("exception not expected", e);
              failureCause = "FAILED::" + e;
              testFailed = true;
              fail("FAILED::" + e);
            }

            Thread th = new Thread(new DoesFlush(region));
            th.setName("TestingThread");
            th.start();
            Thread.yield();
          }
          callOnce = true;
        }

      }
DiskRegOplog1OverridingOplog2JUnitTest: Disk Region test : oplog1 flush overriding oplog2 flush

This test will hold the flush of oplog1 and flush oplog2 before it. After that oplog1 is
allowed to flush. A get of an entry which was first put in oplog1 and then in oplog2 should
result in the get being done from oplog2.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegOplogSwtchingAndRollerJUnitTest.java