Skip to content

Commit

Permalink
fix: 11472 Added @tag(TIMING_SENSITIVE) to the tests to stabilize the…
Browse files Browse the repository at this point in the history
… test pipeline. (#11475)

Signed-off-by: Ivan Malygin <ivan@swirldslabs.com>
  • Loading branch information
imalygin committed Feb 9, 2024
1 parent 00d855a commit 3892609
Show file tree
Hide file tree
Showing 34 changed files with 73 additions and 0 deletions.
Expand Up @@ -47,6 +47,7 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

@Tag(TIMING_SENSITIVE)
@DisplayName("Async Stream Test")
class AsyncStreamTest {
private final Configuration configuration = new TestConfigBuilder()
Expand Down
Expand Up @@ -16,6 +16,8 @@

package com.swirlds.merkle.test;

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

import com.swirlds.common.merkle.crypto.MerkleCryptoFactory;
import com.swirlds.common.merkle.crypto.MerkleCryptography;
import com.swirlds.common.test.fixtures.junit.tags.TestComponentTags;
Expand All @@ -36,6 +38,7 @@
* Benchmarks for merkle hashing.
*/
@DisplayName("Merkle Hash Benchmarks")
@Tag(TIMING_SENSITIVE)
public class MerkleHashBenchmarks {

private static MerkleCryptography cryptography;
Expand Down
Expand Up @@ -18,6 +18,7 @@

import static com.swirlds.common.merkle.hash.MerkleHashChecker.checkHashAndLog;
import static com.swirlds.common.merkle.hash.MerkleHashChecker.getNodesWithInvalidHashes;
import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static java.lang.System.identityHashCode;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Expand Down Expand Up @@ -59,6 +60,7 @@
* Unit tests for merkle tree hashing
*/
@DisplayName("Merkle Hash Tests")
@Tag(TIMING_SENSITIVE)
class MerkleHashTests {

private static MerkleCryptography cryptography;
Expand Down
Expand Up @@ -18,6 +18,7 @@

import static com.swirlds.common.merkle.utility.MerkleUtils.invalidateTree;
import static com.swirlds.common.merkle.utility.MerkleUtils.rehashTree;
import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static com.swirlds.common.test.fixtures.merkle.util.MerkleTestUtils.generateRandomTree;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand Down Expand Up @@ -51,6 +52,7 @@
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;

@Tag(TIMING_SENSITIVE)
@DisplayName("Merkle Rehash Tests")
class MerkleRehashTests {

Expand Down
Expand Up @@ -23,6 +23,7 @@
import static com.swirlds.common.merkle.route.MerkleRouteUtils.merkleRouteToPathFormat;
import static com.swirlds.common.merkle.route.MerkleRouteUtils.pathFormatToMerkleRoute;
import static com.swirlds.common.test.fixtures.RandomUtils.getRandomPrintSeed;
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.assertFalse;
import static org.junit.jupiter.api.Assertions.assertSame;
Expand Down Expand Up @@ -53,6 +54,7 @@
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

@Tag(TIMING_SENSITIVE)
@DisplayName("Merkle Route Tests")
class MerkleRouteTests {

Expand Down
Expand Up @@ -18,6 +18,7 @@

import static com.swirlds.common.io.utility.FileUtils.deleteDirectory;
import static com.swirlds.common.test.fixtures.io.ResourceLoader.getFile;
import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static com.swirlds.common.test.fixtures.merkle.util.MerkleTestUtils.areTreesEqual;
import static com.swirlds.common.test.fixtures.merkle.util.MerkleTestUtils.buildLessSimpleTree;
import static com.swirlds.common.test.fixtures.merkle.util.MerkleTestUtils.buildLessSimpleTreeExtended;
Expand Down Expand Up @@ -71,6 +72,7 @@
import org.junit.jupiter.api.condition.OS;
import org.junit.jupiter.api.io.TempDir;

@Tag(TIMING_SENSITIVE)
@DisplayName("Merkle Serialization Tests")
class MerkleSerializationTests {

Expand Down
Expand Up @@ -18,6 +18,7 @@

import static com.swirlds.base.units.UnitConstants.MICROSECONDS_TO_SECONDS;
import static com.swirlds.common.test.fixtures.io.ResourceLoader.loadLog4jContext;
import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static org.junit.jupiter.api.Assertions.fail;

import com.swirlds.common.constructable.ConstructableRegistry;
Expand All @@ -42,6 +43,7 @@
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;

@Tag(TIMING_SENSITIVE)
public class MerkleSynchronizationBenchmarks {

private static MerkleCryptography cryptography;
Expand Down
Expand Up @@ -18,6 +18,7 @@

import static com.swirlds.common.merkle.copy.MerkleInitialize.initializeTreeAfterCopy;
import static com.swirlds.common.test.fixtures.io.ResourceLoader.loadLog4jContext;
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.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
Expand Down Expand Up @@ -55,6 +56,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;

@Tag(TIMING_SENSITIVE)
@DisplayName("Merkle Synchronization Tests")
public class MerkleSynchronizationTests {
private final Configuration configuration = new TestConfigBuilder().getOrCreateConfig();
Expand Down
Expand Up @@ -16,6 +16,8 @@

package com.swirlds.merkle.test.map;

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

import com.swirlds.common.constructable.ConstructableRegistry;
import com.swirlds.common.constructable.ConstructableRegistryException;
import com.swirlds.common.merkle.crypto.MerkleCryptoFactory;
Expand All @@ -26,6 +28,7 @@
import java.util.concurrent.ExecutionException;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;

Expand All @@ -34,6 +37,7 @@
* The results of these benchmarks are intended to be interpreted using jprofiler.
*/
@DisplayName("MerkleMap Memory Benchmark")
@Tag(TIMING_SENSITIVE)
class MerkleMapMemoryBenchmark {

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

package com.swirlds.merkle.test.map;

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

Expand All @@ -37,6 +38,7 @@
import org.junit.jupiter.params.provider.CsvSource;

@EnabledIfEnvironmentVariable(disabledReason = "Benchmark", named = "benchmark", matches = "true")
@Tag(TIMING_SENSITIVE)
class MerkleMapMemoryTests {

private static final Random PRNG_PROVIDER = new Random(System.currentTimeMillis());
Expand Down
Expand Up @@ -16,14 +16,18 @@

package com.swirlds.merkle.test.map;

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

import com.swirlds.merkle.test.fixtures.map.util.KeyValueProvider;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.params.provider.Arguments;

@DisplayName("MerkleMap Performance Tests")
@Tag(TIMING_SENSITIVE)
public class MerkleMapPerformanceTests extends MerkleMapTests {

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

package com.swirlds.merkle.test.map.benchmark;

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

import com.swirlds.common.constructable.ConstructableRegistry;
Expand Down Expand Up @@ -45,6 +46,7 @@
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;

@DisplayName("MerkleMap Benchmark")
@Tag(TIMING_SENSITIVE)
class MerkleMapBenchmark {

private static final Random random = new Random();
Expand Down
Expand Up @@ -16,13 +16,17 @@

package com.swirlds.merkle.test.tree;

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

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.params.provider.Arguments;

@DisplayName("FCMTree Performance Tests")
@Tag(TIMING_SENSITIVE)
class MerkleBinaryTreePerformanceTests extends MerkleBinaryTreeTests {

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

package com.swirlds.merkle.test.tree;

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.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
Expand Down Expand Up @@ -62,6 +63,7 @@

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@DisplayName("MerkleBinaryTree Tests")
@Tag(TIMING_SENSITIVE)
class MerkleBinaryTreeTests {

private static final long[] ACCOUNT_ID = {1L, 2L, 3L};
Expand Down
Expand Up @@ -16,6 +16,7 @@

package com.swirlds.merkle.test.tree;

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.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
Expand All @@ -41,6 +42,7 @@
import org.junit.jupiter.api.Test;

@DisplayName("MerkleMapEntry Tests")
@Tag(TIMING_SENSITIVE)
class MerkleMapEntryTests {

@Test
Expand Down
Expand Up @@ -17,6 +17,7 @@
package com.swirlds.merkle.test.tree;

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 com.swirlds.merkle.test.tree.MerkleBinaryTreeTests.insertIntoTree;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertNull;
Expand All @@ -40,6 +41,7 @@
import org.junit.jupiter.api.Test;

@DisplayName("MerkleTree Internal Node Tests")
@Tag(TIMING_SENSITIVE)
class MerkleTreeInternalNodeTests {

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

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.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand All @@ -35,6 +36,7 @@
import org.junit.jupiter.api.Tags;
import org.junit.jupiter.api.Test;

@Tag(TIMING_SENSITIVE)
final class MapTest {

VirtualDataSourceBuilder<TestKey, TestValue> createBuilder() {
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 com.swirlds.virtual.merkle.TestKey;
Expand All @@ -31,6 +32,7 @@
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

@Tag(TIMING_SENSITIVE)
@DisplayName("Virtual Map MerkleDB Large Reconnect Test")
class VirtualMapLargeReconnectTest extends VirtualMapReconnectTestBase {

Expand Down
Expand Up @@ -53,6 +53,7 @@
import org.junit.jupiter.params.provider.CsvSource;
import org.junit.jupiter.params.provider.MethodSource;

@Tag(TIMING_SENSITIVE)
@DisplayName("Virtual Map Reconnect Test")
class VirtualMapReconnectTest extends VirtualMapReconnectTestBase {

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

package com.swirlds.virtualmap;

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

import com.swirlds.common.test.fixtures.RandomUtils;
Expand All @@ -24,8 +25,10 @@
import java.util.List;
import java.util.Random;
import java.util.function.Consumer;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

@Tag(TIMING_SENSITIVE)
class VirtualMapRandomTest {
private static final int NUM_ROUNDS = 55;
private static final int NUM_OPS_PER_ROUND = 100;
Expand Down
Expand Up @@ -16,6 +16,7 @@

package com.swirlds.virtualmap;

import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static com.swirlds.metrics.api.Metric.ValueType.VALUE;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
Expand All @@ -34,8 +35,10 @@
import com.swirlds.virtualmap.internal.merkle.VirtualMapStatistics;
import java.util.concurrent.ScheduledExecutorService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

@Tag(TIMING_SENSITIVE)
public class VirtualMapStatisticsTest {

private static final String LABEL = "VMST";
Expand Down
Expand Up @@ -91,6 +91,7 @@
import org.junit.jupiter.api.io.TempDir;

@SuppressWarnings("ALL")
@Tag(TIMING_SENSITIVE)
class VirtualMapTests extends VirtualTestBase {

/**
Expand Down
Expand Up @@ -36,6 +36,7 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

@Tag(TIMING_SENSITIVE)
class ConcurrentNodeStatusTrackerTests {

/**
Expand Down
Expand Up @@ -16,6 +16,7 @@

package com.swirlds.virtualmap.internal.cache;

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;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down Expand Up @@ -43,6 +44,7 @@
/**
*
*/
@Tag(TIMING_SENSITIVE)
class ConcurrentArrayTest {

private final ArrayList<Runnable> cleanupTasks = new ArrayList<>();
Expand Down
Expand Up @@ -17,6 +17,7 @@
package com.swirlds.virtualmap.internal.cache;

import static com.swirlds.common.test.fixtures.AssertionUtils.assertEventuallyDoesNotThrow;
import static com.swirlds.common.test.fixtures.junit.tags.TestQualifierTags.TIMING_SENSITIVE;
import static com.swirlds.virtualmap.internal.cache.VirtualNodeCache.DELETED_HASH;
import static com.swirlds.virtualmap.internal.cache.VirtualNodeCache.DELETED_LEAF_RECORD;
import static com.swirlds.virtualmap.test.fixtures.VirtualMapTestUtils.createMap;
Expand Down Expand Up @@ -65,6 +66,7 @@
import org.junit.jupiter.api.Tags;
import org.junit.jupiter.api.Test;

@Tag(TIMING_SENSITIVE)
class VirtualNodeCacheTest extends VirtualTestBase {
private static final long BOGUS_KEY_ID = -7000;

Expand Down

0 comments on commit 3892609

Please sign in to comment.