Skip to content

check detect time samples before accessing list by index in test_pfcw…#22250

Merged
StormLiangMS merged 1 commit intosonic-net:masterfrom
lipxu:20260205_publicMaster_pfcwd
Mar 3, 2026
Merged

check detect time samples before accessing list by index in test_pfcw…#22250
StormLiangMS merged 1 commit intosonic-net:masterfrom
lipxu:20260205_publicMaster_pfcwd

Conversation

@lipxu
Copy link
Contributor

@lipxu lipxu commented Feb 5, 2026

…d_timer_accuracy

Description of PR

Summary:
Fixes # (issue)
36117223

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
  • 202511

Approach

What is the motivation for this PR?

The error message “IndexError: list index out of range” is unclear and potentially misleading.

How did you do it?

Modify the output error message, check the timestamp sample before accessing the list

How did you verify/test it?

run elastic test
202505
https://elastictest.org/scheduler/testplan/69841fb948d58f009f2c7154

202511
https://elastictest.org/scheduler/testplan/69842120bb7d1dad4c803d16

inject failure
https://elastictest.org/scheduler/testplan/698482c1bb7d1dad4c803dc8

>           pytest.fail(
                "Too many iterations failed to collect PFCWD timestamps. "
                "Detect time samples: {}/{} (failures: {}), Restore time samples: {}/{} (failures: {}). "
                "Required at least {} samples. This may indicate environment or timing issues.".format(
                    detect_count, ITERATION_NUM, detect_failures,
                    restore_count, ITERATION_NUM, restore_failures,
                    required_samples))
E           Failed: Too many iterations failed to collect PFCWD timestamps. Detect time samples: 0/20 (failures: 20), Restore time samples: 0/20 (failures: 20). Required at least 10 samples. This may indicate environment or timing issues.

Any platform specific information?

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

Documentation

…d_timer_accuracy

Signed-off-by: xuliping <xuliping@microsoft.com>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lipxu lipxu marked this pull request as ready for review February 5, 2026 11:38
@lipxu lipxu requested a review from StormLiangMS February 5, 2026 23:28
Copy link
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

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

LGTM

@StormLiangMS StormLiangMS merged commit 48a1b0e into sonic-net:master Mar 3, 2026
18 checks passed
@StormLiangMS StormLiangMS added the Request for 202511 branch Request to backport a change to 202511 branch label Mar 3, 2026
aronovic pushed a commit to aronovic/sonic-mgmt that referenced this pull request Mar 3, 2026
…d_timer_accuracy (sonic-net#22250)

What is the motivation for this PR?
The error message “IndexError: list index out of range” is unclear and potentially misleading.

How did you do it?
Modify the output error message, check the timestamp sample before accessing the list

How did you verify/test it?
run elastic test
202505
https://elastictest.org/scheduler/testplan/69841fb948d58f009f2c7154

202511
https://elastictest.org/scheduler/testplan/69842120bb7d1dad4c803d16

inject failure
https://elastictest.org/scheduler/testplan/698482c1bb7d1dad4c803dc8

>           pytest.fail(
                "Too many iterations failed to collect PFCWD timestamps. "
                "Detect time samples: {}/{} (failures: {}), Restore time samples: {}/{} (failures: {}). "
                "Required at least {} samples. This may indicate environment or timing issues.".format(
                    detect_count, ITERATION_NUM, detect_failures,
                    restore_count, ITERATION_NUM, restore_failures,
                    required_samples))
E           Failed: Too many iterations failed to collect PFCWD timestamps. Detect time samples: 0/20 (failures: 20)
Signed-off-by: xuliping <xuliping@microsoft.com>

Signed-off-by: Mihut Aronovici <aronovic@cisco.com>
rraghav-cisco pushed a commit to rraghav-cisco/sonic-mgmt that referenced this pull request Mar 3, 2026
…d_timer_accuracy (sonic-net#22250)

What is the motivation for this PR?
The error message “IndexError: list index out of range” is unclear and potentially misleading.

How did you do it?
Modify the output error message, check the timestamp sample before accessing the list

How did you verify/test it?
run elastic test
202505
https://elastictest.org/scheduler/testplan/69841fb948d58f009f2c7154

202511
https://elastictest.org/scheduler/testplan/69842120bb7d1dad4c803d16

inject failure
https://elastictest.org/scheduler/testplan/698482c1bb7d1dad4c803dc8

>           pytest.fail(
                "Too many iterations failed to collect PFCWD timestamps. "
                "Detect time samples: {}/{} (failures: {}), Restore time samples: {}/{} (failures: {}). "
                "Required at least {} samples. This may indicate environment or timing issues.".format(
                    detect_count, ITERATION_NUM, detect_failures,
                    restore_count, ITERATION_NUM, restore_failures,
                    required_samples))
E           Failed: Too many iterations failed to collect PFCWD timestamps. Detect time samples: 0/20 (failures: 20)
Signed-off-by: xuliping <xuliping@microsoft.com>

Signed-off-by: Raghavendran Ramanathan <rraghav@cisco.com>
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Mar 3, 2026
…d_timer_accuracy (sonic-net#22250)

What is the motivation for this PR?
The error message “IndexError: list index out of range” is unclear and potentially misleading.

How did you do it?
Modify the output error message, check the timestamp sample before accessing the list

How did you verify/test it?
run elastic test
202505
https://elastictest.org/scheduler/testplan/69841fb948d58f009f2c7154

202511
https://elastictest.org/scheduler/testplan/69842120bb7d1dad4c803d16

inject failure
https://elastictest.org/scheduler/testplan/698482c1bb7d1dad4c803dc8

>           pytest.fail(
                "Too many iterations failed to collect PFCWD timestamps. "
                "Detect time samples: {}/{} (failures: {}), Restore time samples: {}/{} (failures: {}). "
                "Required at least {} samples. This may indicate environment or timing issues.".format(
                    detect_count, ITERATION_NUM, detect_failures,
                    restore_count, ITERATION_NUM, restore_failures,
                    required_samples))
E           Failed: Too many iterations failed to collect PFCWD timestamps. Detect time samples: 0/20 (failures: 20)
Signed-off-by: xuliping <xuliping@microsoft.com>

Signed-off-by: mssonicbld <sonicbld@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202511: #22713

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