From f9ded18b16cedec00ce03daf8e3ee4364133c443 Mon Sep 17 00:00:00 2001 From: olgavrou Date: Wed, 26 Oct 2022 11:36:22 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20don't=20run=20tests=20with=20iterations?= =?UTF-8?q?=20(and=20a=20simulator)=20with=20valgrind=20=E2=80=A6=20(#4251?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/asan.yml | 2 +- test/unit_test/CMakeLists.txt | 2 +- test/unit_test/automl_test.cc | 22 +++++++++++----------- test/unit_test/automl_weights_test.cc | 8 ++++---- test/unit_test/epsilon_decay_test.cc | 8 ++++---- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml index 5d83061f1e9..682c8c49b7e 100644 --- a/.github/workflows/asan.yml +++ b/.github/workflows/asan.yml @@ -84,7 +84,7 @@ jobs: - name: Build run: cmake --build build --target vw_cli_bin spanning_tree vw-unit-test.out - name: Run unit tests - run: ./build/test/unit_test/vw-unit-test.out + run: ./build/test/unit_test/vw-unit-test.out --run_test='!*w_iterations*' - name: Run python test script if: ${{ success() || failure() }} run: python3 test/run_tests.py -f --clean_dirty -E 0.001 --include_flatbuffers diff --git a/test/unit_test/CMakeLists.txt b/test/unit_test/CMakeLists.txt index 4f9428bdcf8..d3188195788 100644 --- a/test/unit_test/CMakeLists.txt +++ b/test/unit_test/CMakeLists.txt @@ -94,7 +94,7 @@ endif() if(VW_UNIT_TEST_WITH_VALGRIND_INTERNAL) add_test( NAME vw_unit_test - COMMAND ${VALGRIND} --error-exitcode=100 --track-origins=yes --leak-check=full $ + COMMAND ${VALGRIND} --error-exitcode=100 --track-origins=yes --leak-check=full $ "--run_test=!*w_iterations*" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) else() diff --git a/test/unit_test/automl_test.cc b/test/unit_test/automl_test.cc index 4e262a64bc9..dc3ab4a8b60 100644 --- a/test/unit_test/automl_test.cc +++ b/test/unit_test/automl_test.cc @@ -131,7 +131,7 @@ using aml_onediff_inclusion = VW::reductions::automl::automl swap_after = {500}; @@ -416,7 +416,7 @@ BOOST_AUTO_TEST_CASE(automl_clear_configs_one_diff) BOOST_CHECK_GT(ctr.back(), 0.65f); } -BOOST_AUTO_TEST_CASE(automl_q_col_consistency) +BOOST_AUTO_TEST_CASE(automl_q_col_consistency_w_iterations) { const size_t seed = 88; const size_t num_iterations = 1000; @@ -429,7 +429,7 @@ BOOST_AUTO_TEST_CASE(automl_q_col_consistency) BOOST_CHECK_CLOSE(ctr_q_col.back(), ctr_aml.back(), FLOAT_TOL); } -BOOST_AUTO_TEST_CASE(one_diff_impl_unittest) +BOOST_AUTO_TEST_CASE(one_diff_impl_unittest_w_iterations) { using namespace VW::reductions::automl; @@ -587,7 +587,7 @@ BOOST_AUTO_TEST_CASE(exc_incl_unit_test) BOOST_CHECK_EQUAL_COLLECTIONS(interactions.begin(), interactions.end(), expected2.begin(), expected2.end()); } -BOOST_AUTO_TEST_CASE(automl_insertion_champ_change) +BOOST_AUTO_TEST_CASE(automl_insertion_champ_change_w_iterations) { const size_t seed = 85; const size_t num_iterations = 4000; diff --git a/test/unit_test/automl_weights_test.cc b/test/unit_test/automl_weights_test.cc index 18ee5867c34..3ab19702f9e 100644 --- a/test/unit_test/automl_weights_test.cc +++ b/test/unit_test/automl_weights_test.cc @@ -149,7 +149,7 @@ bool weights_offset_test(cb_sim&, VW::workspace& all, VW::multi_ex& ec) return true; } -BOOST_AUTO_TEST_CASE(automl_weight_operations) +BOOST_AUTO_TEST_CASE(automl_weight_operations_w_iterations) { const size_t seed = 10; const size_t num_iterations = 1331; @@ -193,7 +193,7 @@ bool all_weights_equal_test(cb_sim&, VW::workspace& all, VW::multi_ex& ec) return true; } -BOOST_AUTO_TEST_CASE(automl_noop_samechampconfig) +BOOST_AUTO_TEST_CASE(automl_noop_samechampconfig_w_iterations) { const size_t seed = 10; const size_t num_iterations = 1742; @@ -212,7 +212,7 @@ BOOST_AUTO_TEST_CASE(automl_noop_samechampconfig) BOOST_CHECK_GT(ctr.back(), 0.4f); } -BOOST_AUTO_TEST_CASE(automl_learn_order) +BOOST_AUTO_TEST_CASE(automl_learn_order_w_iterations) { callback_map test_hooks; @@ -260,7 +260,7 @@ BOOST_AUTO_TEST_CASE(automl_learn_order) BOOST_CHECK_EQUAL(ctr1, ctr2); } -BOOST_AUTO_TEST_CASE(automl_equal_no_automl) +BOOST_AUTO_TEST_CASE(automl_equal_no_automl_w_iterations) { callback_map test_hooks; diff --git a/test/unit_test/epsilon_decay_test.cc b/test/unit_test/epsilon_decay_test.cc index aa798da035c..14e77fdbac4 100644 --- a/test/unit_test/epsilon_decay_test.cc +++ b/test/unit_test/epsilon_decay_test.cc @@ -31,7 +31,7 @@ epsilon_decay_data* get_epsilon_decay_data(VW::workspace& all) } } // namespace epsilon_decay_test -BOOST_AUTO_TEST_CASE(epsilon_decay_test_init) +BOOST_AUTO_TEST_CASE(epsilon_decay_test_init_w_iterations) { // we initialize the reduction pointing to position 0 as champ, that config is hard-coded to empty auto ctr = simulator::_test_helper( @@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE(epsilon_decay_test_init) float with_save = ctr.back(); } -BOOST_AUTO_TEST_CASE(epsilon_decay_test_champ_change) +BOOST_AUTO_TEST_CASE(epsilon_decay_test_champ_change_w_iterations) { const size_t num_iterations = 8000; const std::vector swap_after = {5000}; @@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE(epsilon_decay_test_champ_change) BOOST_CHECK_GT(ctr.back(), 0.6f); } -BOOST_AUTO_TEST_CASE(epsilon_decay_test_update_count) +BOOST_AUTO_TEST_CASE(epsilon_decay_test_update_count_w_iterations) { const size_t num_iterations = 105; const size_t seed = 100; @@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE(epsilon_decay_test_update_count) BOOST_CHECK_GT(ctr.back(), 0.5f); } -BOOST_AUTO_TEST_CASE(epsilon_decay_test_save_load) +BOOST_AUTO_TEST_CASE(epsilon_decay_test_save_load_w_iterations) { callback_map empty_hooks; auto ctr = simulator::_test_helper_hook(