Skip to content

Do not print route info in wait_for_ipv6_bgp_routes_recovery#19289

Merged
yxieca merged 1 commit intosonic-net:masterfrom
weiguo-nvidia:reduce_log
Jul 15, 2025
Merged

Do not print route info in wait_for_ipv6_bgp_routes_recovery#19289
yxieca merged 1 commit intosonic-net:masterfrom
weiguo-nvidia:reduce_log

Conversation

@weiguo-nvidia
Copy link
Copy Markdown
Contributor

@weiguo-nvidia weiguo-nvidia commented Jul 1, 2025

Description of PR

Summary: Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Fixes #
The wait_for_ipv6_bgp_routes_recovery function prints the routing information in the log. However, in the 512 scale setup, due to the large routing scale, the log size exceeds 120M and is difficult to view. So do not print it.

def wait_for_ipv6_bgp_routes_recovery(duthost, expected_routes, start_time, timeout=MAX_CONVERGENCE_WAIT_TIME):
    is_first_run = True
    while not compare_routes(get_all_bgp_ipv6_routes(duthost), expected_routes):
        if datetime.datetime.now() - start_time > datetime.timedelta(seconds=timeout) and not is_first_run:
            logging.info("Actual routes: %s", get_all_bgp_ipv6_routes(duthost))       <<<
            logging.info("Expected routes: %s", expected_routes)                             <<<
            logging.error("BGP routes are not stable in long time")
            return False
        is_first_run = False
    logger.info("Routes are stable after : %s", datetime.datetime.now() - start_time)
    return True

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Approach

What is the motivation for this PR?

How did you do it?

  1. Do not print route info in function wait_for_ipv6_bgp_routes_recovery
  2. Add log in function compare_routes to print the different routes

How did you verify/test it?

Run the case locally, pass

Any platform specific information?

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

Documentation

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@weiguo-nvidia
Copy link
Copy Markdown
Contributor Author

Hi @w1nda , could you help review the PR, thanks!

@w1nda
Copy link
Copy Markdown
Member

w1nda commented Jul 1, 2025

LGTM

If we don't print, how can we debug routes?

Change-Id: Ice438450be79f0d61936f8ffd1682752cb7f10a1
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@weiguo-nvidia
Copy link
Copy Markdown
Contributor Author

weiguo-nvidia commented Jul 3, 2025

LGTM

If we don't print, how can we debug routes?

Hi @w1nda ,

I update function compare_routes to only print the different routes prefix and nexthop between the running_routes and expected_routes

With this change, for test case test_device_unisolation in 512 scale setup, the log size can be reduced from 120M to 19M

This is the log example

[32mINFO    [0m test_ipv6_bgp_scale:test_ipv6_bgp_scale.py:216 Count unmatch, expected_routes count=2557,  running_routes count=2306
[32mINFO    [0m test_ipv6_bgp_scale:test_ipv6_bgp_scale.py:219 Missing prefixes in running_routes: ['fc00:c:c:151::1/128', 'fc00:c:c:1d9::1/128', 'fc00:c:c:176::1/128', 'fc00:c:c:1a1::1/128', 'fc00:c:c:18c::1/128', 'fc00:c:c:15e::1/128', 'fc00:c:c:16a::1/128', 'fc00:c:c:15b::1/128', 'fc00:c:c:161::1/128', 'fc00:c:c:1be::1/128', 'fc00:c:c:15f::1/128', 'fc00:c:c:179::1/128', 'fc00:c:c:1b8::1/128', 'fc00:c:c:4d::1/128', 'fc00:c:c:1ba::1/128', 'fc00:c:c:41::1/128', 'fc00:c:c:36::1/128', 'fc00:c:c:1a5::1/128', 'fc00:c:c:1ad::1/128', 'fc00:c:c:16b::1/128', 'fc00:c:c:1cf::1/128', 'fc00:c:c:4f::1/128', 'fc00:c:c:1ff::1/128', 'fc00:c:c:1ca::1/128', 'fc00:c:c:19c::1/128', 'fc00:c:c:1a6::1/128', 'fc00:c:c:1bc::1/128', 'fc00:c:c:200::1/128', 'fc00:c:c:191::1/128', 'fc00:c:c:3d::1/128', 'fc00:c:c:157::1/128', 'fc00:c:c:1a8::1/128', 'fc00:c:c:55::1/128', 'fc00:c:c:1a9::1/128', 'fc00:c:c:1f9::1/128', 'fc00:c:c:1d1::1/128', 'fc00:c:c:59::1/128', 'fc00:c:c:1fe::1/128', 'fc00:c:c:2c::1/128', 'fc00:c:c:1bb::1/128', 'fc00:c:c:1e2::1/128', 'fc00:c:c:193::1/128', 'fc00:c:c:163::1/128', 'fc00:c:c:33::1/128', 'fc00:c:c:23::1/128', 'fc00:c:c:1ea::1/128', 'fc00:c:c:18f::1/128', 'fc00:c:c:15c::1/128', 'fc00:c:c:1e9::1/128', 'fc00:c:c:1dd::1/128', 'fc00:c:c:1ee::1/128', 'fc00:c:c:17f::1/128', 'fc00:c:c:186::1/128', 'fc00:c:c:1e3::1/128', 'fc00:c:c:16c::1/128', 'fc00:c:c:1ce::1/128', 'fc00:c:c:183::1/128', 'fc00:c:c:8::1/128', 'fc00:c:c:18d::1/128', 'fc00:c:c:172::1/128', 'fc00:c:c:24::1/128', 'fc00:c:c:1d8::1/128', 'fc00:c:c:28::1/128', 'fc00:c:c:1d6::1/128', 'fc00:c:c:38::1/128', 'fc00:c:c:31::1/128', 'fc00:c:c:1b3::1/128', 'fc00:c:c:1e7::1/128', 'fc00:c:c:5e::1/128', 'fc00:c:c:1b1::1/128', 'fc00:c:c:57::1/128', 'fc00:c:c:1c7::1/128', 'fc00:c:c:1fc::1/128', 'fc00:c:c:3f::1/128', 'fc00:c:c:1a3::1/128', 'fc00:c:c:1cd::1/128', 'fc00:c:c:63::1/128', 'fc00:c:c:1c8::1/128', 'fc00:c:c:44::1/128', 'fc00:c:c:1b6::1/128', 'fc00:c:c:39::1/128', 'fc00:c:c:196::1/128', 'fc00:c:c:1ab::1/128', 'fc00:c:c:1d5::1/128', 'fc00:c:c:18b::1/128', 'fc00:c:c:187::1/128', 'fc00:c:c:35::1/128', 'fc00:c:c:1ef::1/128', 'fc00:c:c:56::1/128', 'fc00:c:c:160::1/128', 'fc00:c:c:62::1/128', 'fc00:c:c:14f::1/128', 'fc00:c:c:46::1/128', 'fc00:c:c:1a7::1/128', 'fc00:c:c:1d7::1/128', 'fc00:c:c:5::1/128', 'fc00:c:c:58::1/128', 'fc00:c:c:1ac::1/128', 'fc00:c:c:19a::1/128', 'fc00:c:c:42::1/128', 'fc00:c:c:194::1/128', 'fc00:c:c:2e::1/128', 'fc00:c:c:2b::1/128', 'fc00:c:c:19d::1/128', 'fc00:c:c:184::1/128', 'fc00:c:c:34::1/128', 'fc00:c:c:1f1::1/128', 'fc00:c:c:174::1/128', 'fc00:c:c:175::1/128', 'fc00:c:c:1ae::1/128', 'fc00:c:c:1d2::1/128', 'fc00:c:c:17c::1/128', 'fc00:c:c:4c::1/128', 'fc00:c:c:158::1/128', 'fc00:c:c:1c3::1/128', 'fc00:c:c:156::1/128', 'fc00:c:c:37::1/128', 'fc00:c:c:7::1/128', 'fc00:c:c:4a::1/128', 'fc00:c:c:169::1/128', 'fc00:c:c:166::1/128', 'fc00:c:c:3e::1/128', 'fc00:c:c:150::1/128', 'fc00:c:c:27::1/128', 'fc00:c:c:1b5::1/128', 'fc00:c:c:199::1/128', 'fc00:c:c:155::1/128', 'fc00:c:c:173::1/128', 'fc00:c:c:1f4::1/128', 'fc00:c:c:15a::1/128', 'fc00:c:c:1d0::1/128', 'fc00:c:c:64::1/128', 'fc00:c:c:50::1/128', 'fc00:c:c:1df::1/128', 'fc00:c:c:188::1/128', 'fc00:c:c:1e1::1/128', 'fc00:c:c:a::1/128', 'fc00:c:c:16f::1/128', 'fc00:c:c:1e0::1/128', 'fc00:c:c:159::1/128', 'fc00:c:c:4e::1/128', 'fc00:c:c:1c5::1/128', 'fc00:c:c:2f::1/128', 'fc00:c:c:1f6::1/128', 'fc00:c:c:45::1/128', 'fc00:c:c:3a::1/128', 'fc00:c:c:1c2::1/128', 'fc00:c:c:182::1/128', 'fc00:c:c:17b::1/128', 'fc00:c:c:185::1/128', 'fc00:c:c:190::1/128', 'fc00:c:c:4b::1/128', 'fc00:c:c:164::1/128', 'fc00:c:c:171::1/128', 'fc00:c:c:1de::1/128', 'fc00:c:c:1d3::1/128', 'fc00:c:c:60::1/128', 'fc00:c:c:1bf::1/128', 'fc00:c:c:170::1/128', 'fc00:c:c:5b::1/128', 'fc00:c:c:1da::1/128', 'fc00:c:c:48::1/128', 'fc00:c:c:1f8::1/128', 'fc00:c:c:47::1/128', 'fc00:c:c:1bd::1/128', 'fc00:c:c:167::1/128', 'fc00:c:c:1fd::1/128', 'fc00:c:c:1a4::1/128', 'fc00:c:c:16e::1/128', 'fc00:c:c:5a::1/128', 'fc00:c:c:1a2::1/128', 'fc00:c:c:19b::1/128', 'fc00:c:c:40::1/128', 'fc00:c:c:2a::1/128', 'fc00:c:c:25::1/128', 'fc00:c:c:5c::1/128', 'fc00:c:c:195::1/128', 'fc00:c:c:198::1/128', 'fc00:c:c:165::1/128', 'fc00:c:c:1e6::1/128', 'fc00:c:c:18e::1/128', 'fc00:c:c:168::1/128', 'fc00:c:c:51::1/128', 'fc00:c:c:1e5::1/128', 'fc00:c:c:5d::1/128', 'fc00:c:c:53::1/128', 'fc00:c:c:154::1/128', 'fc00:c:c:30::1/128', 'fc00:c:c:15d::1/128', 'fc00:c:c:1db::1/128', 'fc00:c:c:32::1/128', 'fc00:c:c:1c4::1/128', 'fc00:c:c:1b2::1/128', 'fc00:c:c:1e4::1/128', 'fc00:c:c:1aa::1/128', 'fc00:c:c:181::1/128', 'fc00:c:c:1eb::1/128', 'fc00:c:c:1c1::1/128', 'fc00:c:c:177::1/128', 'fc00:c:c:1e8::1/128', 'fc00:c:c:1b4::1/128', 'fc00:c:c:153::1/128', 'fc00:c:c:1c6::1/128', 'fc00:c:c:192::1/128', 'fc00:c:c:18a::1/128', 'fc00:c:c:6::1/128', 'fc00:c:c:49::1/128', 'fc00:c:c:1cb::1/128', 'fc00:c:c:189::1/128', 'fc00:c:c:178::1/128', 'fc00:c:c:1b0::1/128', 'fc00:c:c:29::1/128', 'fc00:c:c:43::1/128', 'fc00:c:c:1ec::1/128', 'fc00:c:c:17a::1/128', 'fc00:c:c:1c9::1/128', 'fc00:c:c:1ed::1/128', 'fc00:c:c:1f0::1/128', 'fc00:c:c:1a0::1/128', 'fc00:c:c:52::1/128', 'fc00:c:c:54::1/128', 'fc00:c:c:16d::1/128', 'fc00:c:c:152::1/128', 'fc00:c:c:17e::1/128', 'fc00:c:c:1dc::1/128', 'fc00:c:c:17d::1/128', 'fc00:c:c:3b::1/128', 'fc00:c:c:1cc::1/128', 'fc00:c:c:1f2::1/128', 'fc00:c:c:26::1/128', 'fc00:c:c:1b9::1/128', 'fc00:c:c:197::1/128', 'fc00:c:c:19f::1/128', 'fc00:c:c:5f::1/128', 'fc00:c:c:1f7::1/128', 'fc00:c:c:3c::1/128', 'fc00:c:c:1f5::1/128', 'fc00:c:c:1b7::1/128', 'fc00:c:c:19e::1/128', 'fc00:c:c:61::1/128', 'fc00:c:c:1c0::1/128', 'fc00:c:c:162::1/128', 'fc00:c:c:1af::1/128', 'fc00:c:c:1fa::1/128', 'fc00:c:c:9::1/128', 'fc00:c:c:1f3::1/128', 'fc00:c:c:1d4::1/128', 'fc00:c:c:14e::1/128', 'fc00:c:c:2d::1/128', 'fc00:c:c:180::1/128', 'fc00:c:c:1fb::1/128']

@weiguo-nvidia
Copy link
Copy Markdown
Contributor Author

Hi @bingwang-ms @yxieca , could you help review this PR and add 202412 lable?

@weiguo-nvidia
Copy link
Copy Markdown
Contributor Author

Hi @bingwang-ms @yxieca , could you help review and add 202412 label

@yxieca
Copy link
Copy Markdown
Collaborator

yxieca commented Jul 8, 2025

@weiguo-nvidia please fill in the PR comment template. especially following fields:

What is the motivation for this PR?
How did you do it?
How did you verify/test it?

@weiguo-nvidia
Copy link
Copy Markdown
Contributor Author

@weiguo-nvidia please fill in the PR comment template. especially following fields:

What is the motivation for this PR? How did you do it? How did you verify/test it?

I have updated the template, please help review again, thanks!

@roy-sror
Copy link
Copy Markdown
Contributor

@yxieca - your approval is required, following the recent fixes

@yxieca yxieca merged commit 5c35fcd into sonic-net:master Jul 15, 2025
16 checks passed
@weiguo-nvidia weiguo-nvidia deleted the reduce_log branch July 16, 2025 02:23
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jul 16, 2025
…et#19289)

How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202505: #19667

mssonicbld pushed a commit that referenced this pull request Jul 16, 2025
How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass
nissampa pushed a commit to nissampa/sonic-mgmt_dpu_test that referenced this pull request Aug 7, 2025
…et#19289)

How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass
ashutosh-agrawal pushed a commit to ashutosh-agrawal/sonic-mgmt that referenced this pull request Aug 14, 2025
…et#19289)

How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass
vidyac86 pushed a commit to vidyac86/sonic-mgmt that referenced this pull request Oct 23, 2025
…et#19289)

How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
…et#19289)

How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass

Signed-off-by: opcoder0 <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 16, 2025
…et#19289)

How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass

Signed-off-by: Guy Shemesh <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
…et#19289)

How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass

Signed-off-by: Aharon Malkin <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
…et#19289)

How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass

Signed-off-by: Guy Shemesh <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Jan 13, 2026
…et#19289)

How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
…et#19289)

How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass

Signed-off-by: Guy Shemesh <[email protected]>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
…et#19289)

How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass

Signed-off-by: Yael Tzur <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Mar 27, 2026
…et#19289)

How did you do it?
Do not print route info in function wait_for_ipv6_bgp_routes_recovery
Add log in function compare_routes to print the different routes

How did you verify/test it?
Run the case locally, pass
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.

7 participants