Skip to content

Commit

Permalink
fix: mark scheduler tests as timing sensitive (#11470)
Browse files Browse the repository at this point in the history
Signed-off-by: Cody Littley <cody@swirldslabs.com>
Signed-off-by: Kelly Greco <kelly@swirldslabs.com>
Co-authored-by: Kelly Greco <kelly@swirldslabs.com>
  • Loading branch information
cody-littley and poulok committed Feb 9, 2024
1 parent 08a23eb commit 00d855a
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 0 deletions.
Expand Up @@ -16,16 +16,20 @@

package com.swirlds.common;

import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;

import com.swirlds.base.time.Time;
import com.swirlds.common.context.PlatformContext;
import com.swirlds.common.test.fixtures.platform.TestPlatformContextBuilder;
import com.swirlds.common.wiring.model.WiringModel;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.util.concurrent.ForkJoinPool;
import org.junit.jupiter.api.Tag;

/**
* A simple version of a wiring model for scenarios where the wiring model is not needed.
*/
@Tag(TIMING_SENSITIVE)
public final class TestWiringModelBuilder {

private TestWiringModelBuilder() {}
Expand Down
Expand Up @@ -19,6 +19,7 @@
import static com.swirlds.common.test.fixtures.AssertionUtils.assertEventuallyEquals;
import static com.swirlds.common.test.fixtures.AssertionUtils.assertEventuallyTrue;
import static com.swirlds.common.test.fixtures.RandomUtils.getRandomPrintSeed;
import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static java.util.concurrent.TimeUnit.MICROSECONDS;
import static org.junit.jupiter.api.Assertions.assertEquals;

Expand All @@ -35,8 +36,10 @@
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Consumer;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

@Tag(TIMING_SENSITIVE)
class ConcurrentTaskSchedulerTests {

/**
Expand Down
Expand Up @@ -16,18 +16,21 @@

package com.swirlds.common.wiring.schedulers;

import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import com.swirlds.common.wiring.schedulers.internal.DefaultSquelcher;
import com.swirlds.common.wiring.schedulers.internal.Squelcher;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

/**
* Tests for the {@link DefaultSquelcher} class.
*/
@Tag(TIMING_SENSITIVE)
class DefaultSquelcherTests {
@Test
@DisplayName("Standard operation")
Expand Down
Expand Up @@ -17,6 +17,7 @@
package com.swirlds.common.wiring.schedulers;

import static com.swirlds.common.test.fixtures.RandomUtils.getRandomPrintSeed;
import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static com.swirlds.common.utility.NonCryptographicHashing.hash32;
import static org.junit.jupiter.api.Assertions.assertEquals;

Expand All @@ -31,9 +32,11 @@
import java.time.Duration;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

@Tag(TIMING_SENSITIVE)
class DirectTaskSchedulerTests {

@ParameterizedTest
Expand Down
Expand Up @@ -16,6 +16,7 @@

package com.swirlds.common.wiring.schedulers;

import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand All @@ -29,8 +30,10 @@
import java.time.Instant;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.atomic.AtomicLong;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

@Tag(TIMING_SENSITIVE)
class HeartbeatSchedulerTests {

@Test
Expand Down
Expand Up @@ -20,6 +20,7 @@
import static com.swirlds.common.test.fixtures.AssertionUtils.assertEventuallyTrue;
import static com.swirlds.common.test.fixtures.AssertionUtils.completeBeforeTimeout;
import static com.swirlds.common.test.fixtures.RandomUtils.getRandomPrintSeed;
import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static com.swirlds.common.threading.manager.AdHocThreadManager.getStaticThreadManager;
import static com.swirlds.common.utility.NonCryptographicHashing.hash32;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
Expand Down Expand Up @@ -50,10 +51,12 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.function.Function;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

@Tag(TIMING_SENSITIVE)
class SequentialTaskSchedulerTests {

@Test
Expand Down
Expand Up @@ -16,17 +16,20 @@

package com.swirlds.common.wiring.schedulers;

import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;

import com.swirlds.common.wiring.schedulers.internal.Squelcher;
import com.swirlds.common.wiring.schedulers.internal.ThrowingSquelcher;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

/**
* Tests for the {@link ThrowingSquelcher} class.
*/
@Tag(TIMING_SENSITIVE)
class ThrowingSquelcherTests {
@Test
@DisplayName("Standard operation")
Expand Down
Expand Up @@ -18,6 +18,7 @@

import static com.swirlds.common.test.fixtures.AssertionUtils.assertEventuallyEquals;
import static com.swirlds.common.test.fixtures.AssertionUtils.assertEventuallyTrue;
import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static com.swirlds.common.utility.NonCryptographicHashing.hash32;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand All @@ -39,8 +40,10 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Consumer;
import java.util.function.Function;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

@Tag(TIMING_SENSITIVE)
class TaskSchedulerTransformersTests {

@Test
Expand Down
Expand Up @@ -16,6 +16,7 @@

package com.swirlds.common.wiring.wires;

import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

Expand All @@ -30,13 +31,15 @@
import java.util.List;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

/**
* Tests the functionality of output wires
*/
@Tag(TIMING_SENSITIVE)
public class OutputWireTests {

/**
Expand Down
Expand Up @@ -17,6 +17,7 @@
package com.swirlds.virtual.merkle.reconnect;

import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIME_CONSUMING;
import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Expand Down Expand Up @@ -319,6 +320,7 @@ void learnerAbortsReconnectOnFirstOperation(final TreePermutation treePermutatio
@ParameterizedTest
@MethodSource("provideSmallTreePermutations")
@DisplayName("Learner Aborts Reconnect Half Way Through")
@Tag(TIMING_SENSITIVE)
void learnerAbortsReconnectHalfWayThrough(final TreePermutation treePermutation) {
configureReconnectToFailQuickly();

Expand Down

0 comments on commit 00d855a

Please sign in to comment.