When a shard becomes search active then trigger a refresh instead of waiting for the next scheduled refresh.
The `IndexShard#awaitShardSearchActive(...)` method registers a refresh listener and then often waits for the refresh scheduler to trigger a refresh. By default this is one second. In order to avoid increasing the query time of the Search API, the mentioned method should trigger a refresh instead for waiting it to happen.

As part of this change we also need to disable the refresh scheduler completely. Otherwise we run at risk of running two refreshes next after each other. One triggered from making shard search active and one from the refresh scheduler.  



server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java
}
        final long primaryTerm = indexShard.getPendingPrimaryTerm();
        final long translogGen = engineClosed ? -1 : getTranslog(indexShard).getGeneration().translogFileGeneration;
        final Releasable operation1;
        final Releasable operation2;
        if (engineClosed == false) {
            operation1 = acquireReplicaOperationPermitBlockingly(indexShard, primaryTerm);
            assertEquals(1, indexShard.getActiveOperationsCount());
            operation2 = acquireReplicaOperationPermitBlockingly(indexShard, primaryTerm);
            assertEquals(2, indexShard.getActiveOperationsCount());
        } else {
            operation1 = null;
            operation2 = null;
        }
        {
            final AtomicBoolean onResponse = new AtomicBoolean();
            final AtomicReference<Exception> onFailure = new AtomicReference<>();
            final CyclicBarrier barrier = new CyclicBarrier(2);
            final long newPrimaryTerm = primaryTerm + 1 + randomInt(20);
            if (engineClosed == false) {
                assertThat(indexShard.getLocalCheckpoint(), equalTo(SequenceNumbers.NO_OPS_PERFORMED));
                assertThat(indexShard.getLastKnownGlobalCheckpoint(), equalTo(SequenceNumbers.NO_OPS_PERFORMED));
            }
            final long newGlobalCheckPoint;
            if (engineClosed || randomBoolean()) {
                newGlobalCheckPoint = SequenceNumbers.NO_OPS_PERFORMED;
            } else {
                long localCheckPoint = indexShard.getLastKnownGlobalCheckpoint() + randomInt(100);
                
                for (int i = 0; i <= localCheckPoint; i++) {