oktetlabs / test-environment

OKTET Labs Test Environment
Other
5 stars 10 forks source link

te_trc_update tool is broken #17

Closed okt-denispr closed 1 year ago

okt-denispr commented 1 year ago

Hi, I found that te_trc_update_wrapper tool is broken. When I'm trying to use it I see:

te_tester: ../src/engine/tester/test_path.c:991: merge_test_paths: Assertion `FALSE' failed.

This problem is caused by the following commit:

commit 2bd667e9e6acd25b60d771a61a46f939f50b03fe
Author: Ivan Khodyrev <ivan.khodyrev@oktetlabs.ru>
Date:   Tue Jun 20 14:19:50 2023 +0300

    engine/tester: add opt for tester to fail on memory leaks

    At the moment, it is possible to track memory leaks for a
    specific test only by viewing the valgrind log files for
    each test, which is quite time-consuming. The patch adds a
    flag that causes the tests in which a memory leak occurs to
    fail.

    OL-Redmine-Id: 12963
    Signed-off-by: Ivan Khodyrev <ivan.khodyrev@oktetlabs.ru>
    Reviewed-by: Artem Andreev <artem.andreev@oktetlabs.ru>

TESTER_OPT_FAIL_ON_LEAK breaks the order for values that must correspond to test_path_typeof in process_cmd_line_opts function.

Could you please fix it?

ol-khodyrev commented 1 year ago

@okt-denispr, please write an example of how to reproduce this bug.

okt-denispr commented 1 year ago

I used this script to reproduce the problem. It's just a wrapper over te_trc_update_wrapper.

cmd:

./trc_update --test-name=<test_name> --rules-save=rules.xml  --log=<path_to_tmp_raw_log>

To fix it, you just need to take out TESTER_OPT_FAIL_ON_LEAK from the following list of values:

    enum {
        TESTER_OPT_VERSION = 1,

        TESTER_OPT_QUIET,
        ..........
        /*
         * Values from here to TESTER_OPT_FAKE must correspond
         * to test_path_type, do not change order or add/remove
         * items here without updating test_path_type.
         */

        TESTER_OPT_RUN,
        TESTER_OPT_RUN_FORCE,
        TESTER_OPT_RUN_FROM,
        TESTER_OPT_RUN_TO,
        TESTER_OPT_RUN_EXCLUDE,

        TESTER_OPT_VALGRIND,
        TESTER_OPT_GDB,
        TESTER_OPT_FAIL_ON_LEAK, (! it breaks)

        TESTER_OPT_MIX,
        TESTER_OPT_MIX_VALUES,
        TESTER_OPT_MIX_ARGS,
        TESTER_OPT_MIX_TESTS,
        TESTER_OPT_MIX_ITERS,
        TESTER_OPT_MIX_SESSIONS,
        TESTER_OPT_NO_MIX,

        TESTER_OPT_FAKE,

        /*
         * End of list corresponding to test_path_type.
         */
        ....
        TESTER_OPT_CMD_MONITOR,
    };
ol-khodyrev commented 1 year ago

Yes, I have already fixed this error, I just want to check that everything is working correctly now.

okt-denispr commented 1 year ago

In my case, the problem is gone after changing the order. Unfortunately, I do not know an easy way to test this without using one of TS.

ol-arteman commented 1 year ago

Fixed in release v1.16.0 (705d9ae3caf9dc82155e74b7af12b0bd48f106dc)