Skip to content
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

Mizar unittests are not passing #465

Open
Hong-Chang opened this issue Apr 8, 2021 · 1 comment
Open

Mizar unittests are not passing #465

Hong-Chang opened this issue Apr 8, 2021 · 1 comment
Assignees

Comments

@Hong-Chang
Copy link
Collaborator

In Mizar, to execute unit tests, the command is "make run_unittests".

In dev-next branch, after run "make run_unittests", gets following result:
[ FAILED ] test_trn_cli_delete_agent_network_policy_protocol_port_subcmd
[==========] 31 test(s) run.
[ PASSED ] 21 test(s).
[ FAILED ] 10 test(s), listed below:
[ FAILED ] test_trn_cli_load_transit_subcmd
[ FAILED ] test_trn_cli_load_agent_subcmd
[ FAILED ] test_trn_cli_update_transit_network_policy_subcmd
[ FAILED ] test_trn_cli_update_agent_network_policy_subcmd
[ FAILED ] test_trn_cli_delete_transit_network_policy_subcmd
[ FAILED ] test_trn_cli_delete_agent_network_policy_subcmd
[ FAILED ] test_trn_cli_update_transit_network_policy_protocol_port_subcmd
[ FAILED ] test_trn_cli_update_agent_network_policy_protocol_port_subcmd
[ FAILED ] test_trn_cli_delete_transit_network_policy_protocol_port_subcmd
[ FAILED ] test_trn_cli_delete_agent_network_policy_protocol_port_subcmd

10 FAILED TEST(S)

=================================================================
==931026==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 64 byte(s) in 1 object(s) allocated from:
#0 0x55c7f9a90a65 in __interceptor_malloc (/home/ubuntu/go/src/k8s.io/mizar/build/tests/test_cli+0x24a65)
#1 0x55c7f9aed942 in cJSON_New_Item src/extern/cJSON.c:214
#2 0x55c7f9aed942 in cJSON_ParseWithOpts src/extern/cJSON.c:1029
#3 0x55c7f9aed942 in cJSON_Parse src/extern/cJSON.c:1092
#4 0x55c7f9ad3e07 in trn_cli_parse_json src/cli/trn_cli_common.c:29
#5 0x55c7f9add107 in trn_cli_delete_transit_network_policy_protocol_port_subcmd src/cli/trn_cli_network_policy.c:588
#6 0x55c7f9abfc8c in test_trn_cli_delete_transit_network_policy_protocol_port_subcmd src/cli/test/test_cli.c:3014
#7 0x7fe901a52c17 (/usr/lib/x86_64-linux-gnu/libcmocka.so.0+0x4c17)
......

The tips to run single unit test:

  • In src/cli/test/test_cli.c, in last part of the code, comment out all other test cases and only leave one case to run.
  • Can use printf to see why it's failing.
@clu2xlu
Copy link
Contributor

clu2xlu commented Jun 3, 2021

@phudtran this commit fcd97a0
caused failure for:
[ FAILED ] test_trn_cli_load_transit_subcmd
[ FAILED ] test_trn_cli_load_agent_subcmd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants