Skip to content

Commit

Permalink
Merge pull request #485 from ethereum/smt_fix_z3
Browse files Browse the repository at this point in the history
Don't check SMTChecker test if timeout
  • Loading branch information
leonardoalt committed Aug 12, 2020
2 parents f2b77cb + acee3a5 commit 0cf4948
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/smtcallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ tape('SMTCheckerCallback', function (t) {
// Run all tests
for (i in tests) {
var test = tests[i];

// Z3's nondeterminism sometimes causes a test to timeout in one context but not in the other,
// so if we see timeout we skip a potentially misleading run.
var findError = (errorMsg) => { return errorMsg.includes('Error trying to invoke SMT solver'); };
if (test.expectations.find(findError) !== undefined) {
st.skip('Test contains timeout which may have been caused by nondeterminism.');
continue;
}

var output = JSON.parse(solc.compile(
JSON.stringify({
language: 'Solidity',
Expand All @@ -180,6 +189,11 @@ tape('SMTCheckerCallback', function (t) {
continue;
}

if (test.errors.find(findError) !== undefined) {
st.skip('Test contains timeout which may have been caused by nondeterminism.');
continue;
}

// Compare expected vs obtained errors
st.ok(expectErrors(test.expectations, test.errors));
}
Expand Down

0 comments on commit 0cf4948

Please sign in to comment.