/*
 * Copyright 2014-2021 Real Logic Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.aeron.driver;

import org.junit.jupiter.api.RepeatedTest;

import java.util.concurrent.TimeUnit;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.lessThanOrEqualTo;

public class OptimalMulticastDelayGeneratorTest
{
    private static final long MAX_BACKOFF = TimeUnit.MILLISECONDS.toNanos(60);
    private static final long GROUP_SIZE = 10;

    private final OptimalMulticastDelayGenerator generator = new OptimalMulticastDelayGenerator(
        MAX_BACKOFF, GROUP_SIZE);

    @RepeatedTest(100_000)
    public void shouldNotExceedTmaxBackoff()
    {
        final double delay = generator.generateNewOptimalDelay();
        assertThat(delay, lessThanOrEqualTo((double)MAX_BACKOFF));
    }
}

@@ -653,24 +653,16 @@
 ter.api.
-Repeated
 Test;%0A%0Ai
@@ -989,23 +989,80 @@
 0;%0A%0A    
-private
+@Test%0A    public void shouldNotExceedTmaxBackoff()%0A    %7B%0A       
  final O
@@ -1138,25 +1138,16 @@
 nerator(
-%0A        
 MAX_BACK
@@ -1173,82 +1173,60 @@
     
-@RepeatedTest(
+    for (int i = 0; i %3C 
 100_000
+; i++
 )%0A    
-public void shouldNotExceedTmaxBackoff()
+    %7B
 %0A    
-%7B%0A
     
@@ -1287,16 +1287,20 @@
 elay();%0A
+    
         
@@ -1358,16 +1358,26 @@
 KOFF));%0A
+        %7D%0A
     %7D%0A%7D%0A

Revert PR #1168 due to build time increase.