Skip to content

Catch exception for test_tunnel_memory_leak and add debug info#7209

Merged
ZhaohuiS merged 2 commits intosonic-net:masterfrom
ZhaohuiS:fix/loose_test_tunnel_memory_leak
Jan 9, 2023
Merged

Catch exception for test_tunnel_memory_leak and add debug info#7209
ZhaohuiS merged 2 commits intosonic-net:masterfrom
ZhaohuiS:fix/loose_test_tunnel_memory_leak

Conversation

@ZhaohuiS
Copy link
Contributor

@ZhaohuiS ZhaohuiS commented Jan 8, 2023

Signed-off-by: Zhaohui Sun zhaohuisun@microsoft.com

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

In nightly test, for test_tunnel_memory_leak case, it will send 1000 packets for every server port and will check if every port receives packets. Sometimes, unstable test environment always fails the case, especially for dualtor-120, even one server can't receive packets, the case will fail.
But this case's purpose is to check if there is memory leak for tunnel_packet_handler.
Loose the pass condition for this case, if memory check fail, this case will fail, add debug info for unreceived scenarios for further check.

How did you do it?

Catch exception if doesn't receive expected packets.
Count expected and unexpected number.

How did you verify/test it?

Run dualtor/test_tunnel_memory_leak.py.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
unexpected_count += 1
else:
expected_count += 1
logging.info("The count of expected to receive packets: {}, unexpected count: {}.".format(expected_count, unexpected_count))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the count here pkts counts? @ZhaohuiS, from code, looks like it is the count how many times send PACKET_COUNT pkts. If so, the log is confusing.

Copy link
Contributor Author

@ZhaohuiS ZhaohuiS Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StormLiangMS It counts the number of expected scenarios, not the received packet number, I update the comment.

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
@ZhaohuiS ZhaohuiS merged commit 9d423a1 into sonic-net:master Jan 9, 2023
wangxin pushed a commit that referenced this pull request Jan 10, 2023
What is the motivation for this PR?
In nightly test, for test_tunnel_memory_leak case, it will send 1000 packets for every server port and will check if every port receives packets. Sometimes, unstable test environment always fails the case, especially for dualtor-120, even one server can't receive packets, the case will fail.
But this case's purpose is to check if there is memory leak for tunnel_packet_handler.
Loose the pass condition for this case, if memory check fail, this case will fail, add debug info for unreceived scenarios for further check.

How did you do it?
Catch exception if doesn't receive expected packets.
Count expected and unexpected number.

How did you verify/test it?
Run dualtor/test_tunnel_memory_leak.py

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants