Skip to content

Commit

Permalink
Mark more tests as flaky
Browse files Browse the repository at this point in the history
This adds the necessary annotation to repeat flaky tests if necessary
for tests described in these issues:
* JanusGraph#1457
* JanusGraph#1459
* JanusGraph#1462
* JanusGraph#1464
* JanusGraph#1465
* JanusGraph#1497
* JanusGraph#2272
* JanusGraph#3142
* JanusGraph#3356
* JanusGraph#3392
* JanusGraph#3393
* JanusGraph#3651
* JanusGraph#3931
* JanusGraph#3959
* JanusGraph#3960

Signed-off-by: Florian Hockmann <[email protected]>
  • Loading branch information
FlorianHockmann committed Sep 7, 2023
1 parent e2b0bed commit 1f8a634
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2188,7 +2188,7 @@ public void testIndexReplay() throws Exception {
assertEquals(4, recoveryStats[1]); //all 4 index transaction had provoked errors in the indexing backend
}

@Test
@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
public void testIndexUpdatesWithoutReindex() throws InterruptedException, ExecutionException {
final Object[] settings = new Object[]{option(LOG_SEND_DELAY, MANAGEMENT_LOG), Duration.ofMillis(0),
option(KCVSLog.LOG_READ_LAG_TIME, MANAGEMENT_LOG), Duration.ofMillis(50),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import io.github.artsok.RepeatedIfExceptionsTest;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Vertex;
Expand Down Expand Up @@ -127,7 +128,7 @@ private void verifyLockingOverwrite(long num) {
}
}

@Test
@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
public void testIdCounts() {
makeVertexIndexedUniqueKey("uid", Integer.class);
mgmt.setConsistency(mgmt.getGraphIndex("uid"), ConsistencyModifier.LOCK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

package org.janusgraph.graphdb.berkeleyje;

import io.github.artsok.RepeatedIfExceptionsTest;
import org.janusgraph.BerkeleyStorageSetup;
import org.janusgraph.diskstorage.configuration.WriteConfiguration;
import org.janusgraph.graphdb.JanusGraphOperationCountingTest;
Expand All @@ -27,12 +26,6 @@ public WriteConfiguration getBaseConfiguration() {
return BerkeleyStorageSetup.getBerkeleyJEGraphConfiguration();
}

@Override
@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
public void testIdCounts() {
super.testIdCounts();
}

@AfterEach
public void resetCounts() {
resetMetrics(); // Metrics is a singleton, so subsequents test runs have wrong counts if we don't clean up.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void createConfigurationShouldSupportMultiHosts() throws Exception {
}
}

@Test
@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
public void dropGraphShouldRemoveGraphKeyspace() throws Exception {
final MapConfiguration graphConfig = getGraphConfig();
final String graphName = graphConfig.getString(GRAPH_NAME.toStringWithoutRoot());
Expand Down Expand Up @@ -137,5 +137,11 @@ public void dropGraphShouldRemoveGraphKeyspace() throws Exception {
public void updateConfigurationShouldRemoveGraphFromCache() throws Exception {
super.updateConfigurationShouldRemoveGraphFromCache();
}

@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void dropShouldCleanUpTraversalSourceAndBindings() throws Exception {
super.dropShouldCleanUpTraversalSourceAndBindings();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@

package org.janusgraph.graphdb.cql;

import io.github.artsok.ParameterizedRepeatedIfExceptionsTest;
import io.github.artsok.RepeatedIfExceptionsTest;
import org.janusgraph.JanusGraphCassandraContainer;
import org.janusgraph.StorageSetup;
import org.janusgraph.diskstorage.configuration.WriteConfiguration;
import org.janusgraph.graphdb.JanusGraphTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.util.concurrent.ExecutionException;

@Testcontainers
public class CQLGraphCacheTest extends JanusGraphTest {

Expand All @@ -31,4 +36,46 @@ public class CQLGraphCacheTest extends JanusGraphTest {
public WriteConfiguration getConfiguration() {
return StorageSetup.addPermanentCache(cqlContainer.getConfiguration(getClass().getSimpleName()));
}

@ParameterizedRepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@ValueSource(booleans = {true, false})
public void simpleLogTest(boolean useStringId) throws InterruptedException {
super.simpleLogTest(useStringId);
}

@ParameterizedRepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@ValueSource(booleans = {true, false})
public void simpleLogTestWithFailure(boolean useStringId) throws InterruptedException {
super.simpleLogTestWithFailure(useStringId);
}

@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void testEdgeTTLTiming() throws Exception {
super.testEdgeTTLTiming();
}

@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void testEdgeTTLWithTransactions() throws Exception {
super.testEdgeTTLWithTransactions();
}

@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void testVertexTTLWithCompositeIndex() throws Exception {
super.testVertexTTLWithCompositeIndex();
}

@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void testVertexTTLImplicitKey() throws Exception {
super.testVertexTTLImplicitKey();
}

@RepeatedIfExceptionsTest(repeats = 3)
@Override
public void testReindexingForEdgeIndex() throws ExecutionException, InterruptedException {
super.testReindexingForEdgeIndex();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package org.janusgraph.graphdb.cql;

import io.github.artsok.ParameterizedRepeatedIfExceptionsTest;
import io.github.artsok.RepeatedIfExceptionsTest;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
Expand Down Expand Up @@ -227,18 +228,34 @@ public void testHasTTL() {
assertTrue(features.hasCellTTL());
}

@ParameterizedTest
@ParameterizedRepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@ValueSource(booleans = {true, false})
public void simpleLogTest(boolean useStringId) {
for (int i = 0; i < 3; i++) {
try {
super.simpleLogTest(useStringId);
// If the test passes, break out of the loop.
break;
} catch (Exception ex) {
log.info("Attempt #{} fails", i, ex);
}
}
public void simpleLogTest(boolean useStringId) throws InterruptedException {
super.simpleLogTest(useStringId);
}

@ParameterizedRepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@ValueSource(booleans = {true, false})
public void simpleLogTestWithFailure(boolean useStringId) throws InterruptedException {
super.simpleLogTestWithFailure(useStringId);
}

@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void testEdgeTTLTiming() throws Exception {
super.testEdgeTTLTiming();
}

@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void testVertexTTLWithCompositeIndex() throws Exception {
super.testVertexTTLWithCompositeIndex();
}

@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void testVertexTTLImplicitKey() throws Exception {
super.testVertexTTLImplicitKey();
}

@RepeatedIfExceptionsTest(repeats = 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package org.janusgraph.graphdb.cql;

import io.github.artsok.RepeatedIfExceptionsTest;
import org.janusgraph.JanusGraphCassandraContainer;
import org.janusgraph.diskstorage.configuration.WriteConfiguration;
import org.janusgraph.olap.OLAPTest;
Expand All @@ -29,4 +30,10 @@ public class CQLOLAPTest extends OLAPTest {
public WriteConfiguration getConfiguration() {
return cqlContainer.getConfiguration(getClass().getSimpleName()).getConfiguration();
}

@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void testShortestDistance() throws Exception {
super.testShortestDistance();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public ModifiableConfiguration getStorageConfiguration() {
return getBerkeleyJEConfiguration();
}

@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void indexShouldNotExistAfterDeletion() throws Exception {
super.indexShouldNotExistAfterDeletion();
}

/**
* Test {@link org.janusgraph.example.GraphOfTheGodsFactory#create(String)}.
*/
Expand All @@ -55,9 +61,15 @@ public void testGraphOfTheGodsFactoryCreate() {
gotg.close();
}

@RepeatedIfExceptionsTest(repeats = 3)
@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void testDisableAndDiscardManuallyAndDropEnabledIndex() throws Exception {
super.testDisableAndDiscardManuallyAndDropEnabledIndex();
}

@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void testIndexUpdatesWithoutReindex() throws InterruptedException, ExecutionException {
super.testIndexUpdatesWithoutReindex();
public void testDiscardAndDropRegisteredIndex() throws ExecutionException, InterruptedException {
super.testDiscardAndDropRegisteredIndex();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@

package org.janusgraph.diskstorage.es;

import io.github.artsok.RepeatedIfExceptionsTest;
import org.janusgraph.JanusGraphCassandraContainer;
import org.janusgraph.diskstorage.configuration.ModifiableConfiguration;
import org.junit.jupiter.api.Disabled;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.util.concurrent.ExecutionException;

@Testcontainers
public class CQLElasticsearchTest extends ElasticsearchJanusGraphIndexTest {

Expand All @@ -37,10 +34,4 @@ public ModifiableConfiguration getStorageConfiguration() {
@Override
@Disabled("CQL seems to not clear storage correctly")
public void testClearStorage() {}

@RepeatedIfExceptionsTest(repeats = 3)
@Override
public void testIndexUpdatesWithoutReindex() throws InterruptedException, ExecutionException {
super.testIndexUpdatesWithoutReindex();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package org.janusgraph.diskstorage.solr;

import io.github.artsok.RepeatedIfExceptionsTest;
import org.janusgraph.JanusGraphCassandraContainer;
import org.janusgraph.diskstorage.configuration.ModifiableConfiguration;
import org.junit.jupiter.api.Test;
Expand All @@ -38,6 +39,12 @@ public boolean supportsWildcardQuery() {
return false;
}

@RepeatedIfExceptionsTest(repeats = 4, minSuccess = 2)
@Override
public void testSetIndexing() {
super.testSetIndexing();
}

@Test
@Override
public void testDiscardAndDropRegisteredIndex() {
Expand Down

1 comment on commit 1f8a634

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 1f8a634 Previous: c7f1414 Ratio
org.janusgraph.JanusGraphSpeedBenchmark.basicAddAndDelete 14997.895966164444 ms/op 14772.285396867375 ms/op 1.02
org.janusgraph.GraphCentricQueryBenchmark.getVertices 1403.9864673669827 ms/op 1342.9164919035395 ms/op 1.05
org.janusgraph.MgmtOlapJobBenchmark.runClearIndex 221.87963666086958 ms/op 220.70036411304346 ms/op 1.01
org.janusgraph.MgmtOlapJobBenchmark.runReindex 476.3075063196969 ms/op 459.0111434233333 ms/op 1.04
org.janusgraph.JanusGraphSpeedBenchmark.basicCount 430.322040532258 ms/op 448.3045679561699 ms/op 0.96
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.getValuesAllPropertiesWithAllMultiQuerySlicesUnderMaxRequestsPerConnection 9940.97825727369 ms/op 9471.554114015158 ms/op 1.05
org.janusgraph.CQLMultiQueryBenchmark.getElementsWithUsingEmitRepeatSteps 34181.104529582146 ms/op 30530.37279627738 ms/op 1.12
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.getValuesMultiplePropertiesWithSmallBatch 35496.98493976238 ms/op 32476.63245072667 ms/op 1.09
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.vertexCentricPropertiesFetching 73163.0019438 ms/op 64093.591921533334 ms/op 1.14
org.janusgraph.CQLMultiQueryBenchmark.getAllElementsTraversedFromOuterVertex 17167.173211595386 ms/op 15042.202489367737 ms/op 1.14
org.janusgraph.CQLMultiQueryBenchmark.getVerticesWithDoubleUnion 628.6140805248464 ms/op 631.6276234193223 ms/op 1.00
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.getValuesAllPropertiesWithUnlimitedBatch 9130.824532475865 ms/op 8447.536840309913 ms/op 1.08
org.janusgraph.CQLMultiQueryBenchmark.getNames 17315.754770635627 ms/op 15179.44834944657 ms/op 1.14
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.getValuesThreePropertiesWithAllMultiQuerySlicesUnderMaxRequestsPerConnection 11924.46594077147 ms/op 10729.568809522068 ms/op 1.11
org.janusgraph.CQLMultiQueryBenchmark.getLabels 14431.392068430876 ms/op 12903.36908605266 ms/op 1.12
org.janusgraph.CQLMultiQueryBenchmark.getVerticesFilteredByAndStep 704.0860246502033 ms/op 679.4238113266226 ms/op 1.04
org.janusgraph.CQLMultiQueryBenchmark.getVerticesFromMultiNestedRepeatStepStartingFromSingleVertex 23503.207005322543 ms/op 21721.90490216222 ms/op 1.08
org.janusgraph.CQLMultiQueryBenchmark.getVerticesWithCoalesceUsage 613.0003974019944 ms/op 583.5549561862205 ms/op 1.05
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.getValuesMultiplePropertiesWithAllMultiQuerySlicesUnderMaxRequestsPerConnection 31278.02115408667 ms/op 28383.153141379546 ms/op 1.10
org.janusgraph.CQLMultiQueryBenchmark.getIdToOutVerticesProjection 428.4540586393154 ms/op 427.8717122579767 ms/op 1.00
org.janusgraph.CQLMultiQueryMultiSlicesBenchmark.getValuesMultiplePropertiesWithUnlimitedBatch 32313.374252598413 ms/op 29486.677584189485 ms/op 1.10
org.janusgraph.CQLMultiQueryBenchmark.getNeighborNames 17347.616279232683 ms/op 15116.173494440423 ms/op 1.15
org.janusgraph.CQLMultiQueryBenchmark.getElementsWithUsingRepeatUntilSteps 18132.32939772228 ms/op 16338.168670766294 ms/op 1.11
org.janusgraph.CQLMultiQueryBenchmark.getAdjacentVerticesLocalCounts 17205.300196557146 ms/op 15408.99258218643 ms/op 1.12

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.