Skip to content

Disable the flaky tests for CVC5 #473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions src/org/sosy_lab/java_smt/test/SolverConcurrencyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ public void checkThatSolverIsAvailable() throws InvalidConfigurationException {
.that(solver)
.isNotEqualTo(Solvers.MATHSAT5);
}

assume()
.withMessage("Solver does not support concurrency without concurrent context.")
.that(solver)
.isNotEqualTo(Solvers.CVC5);
}

private void requireConcurrentMultipleStackSupport() {
Expand Down Expand Up @@ -298,7 +303,7 @@ public void testFormulaTranslationWithConcurrentContexts()
assume()
.withMessage("Solver does not support translation of formulas")
.that(solver)
.isNoneOf(Solvers.CVC4, Solvers.PRINCESS, Solvers.CVC5);
.isNoneOf(Solvers.CVC4, Solvers.PRINCESS);

ConcurrentLinkedQueue<ContextAndFormula> contextAndFormulaList = new ConcurrentLinkedQueue<>();

Expand Down Expand Up @@ -348,11 +353,6 @@ public void testFormulaTranslationWithConcurrentContexts()
public void testIntConcurrencyWithoutConcurrentContext() throws InvalidConfigurationException {
requireIntegers();

assume()
.withMessage("Solver does not support concurrency without concurrent context.")
.that(solver)
.isNotEqualTo(Solvers.CVC5);

ConcurrentLinkedQueue<SolverContext> contextList = new ConcurrentLinkedQueue<>();
// Initialize contexts before using them in the threads
for (int i = 0; i < NUMBER_OF_THREADS; i++) {
Expand All @@ -373,11 +373,6 @@ public void testIntConcurrencyWithoutConcurrentContext() throws InvalidConfigura
public void testBvConcurrencyWithoutConcurrentContext() throws InvalidConfigurationException {
requireBitvectors();

assume()
.withMessage("Solver does not support concurrency without concurrent context.")
.that(solver)
.isNotEqualTo(Solvers.CVC5);

ConcurrentLinkedQueue<SolverContext> contextList = new ConcurrentLinkedQueue<>();
// Initialize contexts before using them in the threads
for (int i = 0; i < NUMBER_OF_THREADS; i++) {
Expand Down Expand Up @@ -545,7 +540,7 @@ public void continuousRunningThreadFormulaTransferTranslateTest() {
assume()
.withMessage("Solver does not support translation of formulas")
.that(solver)
.isNoneOf(Solvers.CVC4, Solvers.CVC5, Solvers.PRINCESS);
.isNoneOf(Solvers.CVC4, Solvers.PRINCESS);

// This is fine! We might access this more than once at a time,
// but that gives only access to the bucket, which is threadsafe.
Expand Down
31 changes: 13 additions & 18 deletions src/org/sosy_lab/java_smt/test/TimeoutTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@

package org.sosy_lab.java_smt.test;

import static com.google.common.truth.TruthJUnit.assume;
import static org.junit.Assert.assertThrows;

import com.google.common.truth.TruthJUnit;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.function.Supplier;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
Expand Down Expand Up @@ -62,13 +63,20 @@ protected Logics logicToUse() {
return Logics.QF_LIA;
}

@Before
public void setUp() {
// FIXME CVC5 has interruptions, but crashes on Windows, probably due to concurrency issues
// TODO Add interruption for Princess
assume()
.withMessage(solverToUse() + " does not support interruption")
.that(solverToUse())
.isNoneOf(Solvers.PRINCESS, Solvers.CVC5);
}

@Test
@SuppressWarnings("CheckReturnValue")
public void testTacticTimeout() {
TruthJUnit.assume()
.withMessage("Only Z3 has native tactics")
.that(solverToUse())
.isEqualTo(Solvers.Z3);
assume().withMessage("Only Z3 has native tactics").that(solverToUse()).isEqualTo(Solvers.Z3);
Fuzzer fuzzer = new Fuzzer(mgr, new Random(0));
String msg = "ShutdownRequest";
BooleanFormula test = fuzzer.fuzz(20, 3);
Expand All @@ -79,32 +87,19 @@ public void testTacticTimeout() {
@Test(timeout = TIMEOUT_MILLISECONDS)
public void testProverTimeoutInt() throws InterruptedException {
requireIntegers();
TruthJUnit.assume()
.withMessage(solverToUse() + " does not support interruption")
.that(solverToUse())
.isNoneOf(Solvers.PRINCESS, Solvers.BOOLECTOR, Solvers.CVC5);
testBasicProverTimeoutInt(() -> context.newProverEnvironment());
}

@Test(timeout = TIMEOUT_MILLISECONDS)
public void testProverTimeoutBv() throws InterruptedException {
requireBitvectors();
TruthJUnit.assume()
.withMessage(solverToUse() + " does not support interruption")
.that(solverToUse())
.isNoneOf(Solvers.PRINCESS, Solvers.CVC5);

testBasicProverTimeoutBv(() -> context.newProverEnvironment());
}

@Test(timeout = TIMEOUT_MILLISECONDS)
public void testInterpolationProverTimeout() throws InterruptedException {
requireInterpolation();
requireIntegers();
TruthJUnit.assume()
.withMessage(solverToUse() + " does not support interruption")
.that(solverToUse())
.isNoneOf(Solvers.PRINCESS, Solvers.BOOLECTOR, Solvers.CVC5);
testBasicProverTimeoutInt(() -> context.newProverEnvironmentWithInterpolation());
}

Expand Down