Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Reduce max time allowed for checktime_hashing_fail test
Browse files Browse the repository at this point in the history
On my box I'm seeing periodic failures here where the code completes before 10ms. Reduce the allowed time to 3ms (picked via fair dice roll)
  • Loading branch information
spoonincode committed Feb 21, 2019
1 parent ba16735 commit 7facd29
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions unittests/api_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -982,42 +982,42 @@ BOOST_FIXTURE_TEST_CASE(checktime_hashing_fail, TESTER) { try {

//hit deadline exception, but cache the contract
BOOST_CHECK_EXCEPTION( call_test( *this, test_api_action<TEST_METHOD("test_checktime", "checktime_sha1_failure")>{},
5000, 10 ),
5000, 3 ),
deadline_exception, is_deadline_exception );

#warning TODO validate that the contract was successfully cached

//the contract should be cached, now we should get deadline_exception because of calls to checktime() from hashing function
BOOST_CHECK_EXCEPTION( call_test( *this, test_api_action<TEST_METHOD("test_checktime", "checktime_sha1_failure")>{},
5000, 10 ),
5000, 3 ),
deadline_exception, is_deadline_exception );

BOOST_CHECK_EXCEPTION( call_test( *this, test_api_action<TEST_METHOD("test_checktime", "checktime_assert_sha1_failure")>{},
5000, 10 ),
5000, 3 ),
deadline_exception, is_deadline_exception );

BOOST_CHECK_EXCEPTION( call_test( *this, test_api_action<TEST_METHOD("test_checktime", "checktime_sha256_failure")>{},
5000, 10 ),
5000, 3 ),
deadline_exception, is_deadline_exception );

BOOST_CHECK_EXCEPTION( call_test( *this, test_api_action<TEST_METHOD("test_checktime", "checktime_assert_sha256_failure")>{},
5000, 10 ),
5000, 3 ),
deadline_exception, is_deadline_exception );

BOOST_CHECK_EXCEPTION( call_test( *this, test_api_action<TEST_METHOD("test_checktime", "checktime_sha512_failure")>{},
5000, 10 ),
5000, 3 ),
deadline_exception, is_deadline_exception );

BOOST_CHECK_EXCEPTION( call_test( *this, test_api_action<TEST_METHOD("test_checktime", "checktime_assert_sha512_failure")>{},
5000, 10 ),
5000, 3 ),
deadline_exception, is_deadline_exception );

BOOST_CHECK_EXCEPTION( call_test( *this, test_api_action<TEST_METHOD("test_checktime", "checktime_ripemd160_failure")>{},
5000, 10 ),
5000, 3 ),
deadline_exception, is_deadline_exception );

BOOST_CHECK_EXCEPTION( call_test( *this, test_api_action<TEST_METHOD("test_checktime", "checktime_assert_ripemd160_failure")>{},
5000, 10 ),
5000, 3 ),
deadline_exception, is_deadline_exception );

BOOST_REQUIRE_EQUAL( validate(), true );
Expand Down

0 comments on commit 7facd29

Please sign in to comment.