Skip to content

Added detailed reason for assert failure for gnmi,snmp#19758

Merged
StormLiangMS merged 1 commit intosonic-net:masterfrom
bachalla:gnmi_snmp
Jul 30, 2025
Merged

Added detailed reason for assert failure for gnmi,snmp#19758
StormLiangMS merged 1 commit intosonic-net:masterfrom
bachalla:gnmi_snmp

Conversation

@bachalla
Copy link
Copy Markdown
Contributor

Description of PR

Added detailed Reason for Assert failure

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

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@bachalla bachalla requested a review from ZhaohuiS July 22, 2025 10:19
@bachalla
Copy link
Copy Markdown
Contributor Author

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

"Expected count of 'oid': {}"
"Actual count of 'oid': {}"
"Message: {}"
).format(test_data["name"], msg, exp_cnt, msg.count("oid"), msg)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@bachalla don't need to print msg twice, please remove the last one.

@ZhaohuiS
Copy link
Copy Markdown
Contributor

@bachalla could you please provide the test evidence?

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@bachalla
Copy link
Copy Markdown
Contributor Author

image image

Copy link
Copy Markdown
Contributor

@ZhaohuiS ZhaohuiS left a comment

Choose a reason for hiding this comment

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

Looks good to me

Copy link
Copy Markdown
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 5a16582 into sonic-net:master Jul 30, 2025
15 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jul 31, 2025
)

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202505: #19953

mssonicbld pushed a commit that referenced this pull request Jul 31, 2025
Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally
nissampa pushed a commit to nissampa/sonic-mgmt_dpu_test that referenced this pull request Aug 7, 2025
)

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally
ashutosh-agrawal pushed a commit to ashutosh-agrawal/sonic-mgmt that referenced this pull request Aug 14, 2025
)

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally
vidyac86 pushed a commit to vidyac86/sonic-mgmt that referenced this pull request Oct 23, 2025
)

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
)

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally

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

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally

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

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally

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

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally

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
)

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
)

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally

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

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally

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
)

Summary:

Enhanced assertion messages in selected test cases to provide clearer failure context. This improves debuggability and speeds up issue resolution when tests fail.
Added detailed assertion failure messages in test scripts to make it easier to understand why tests fails.

What is the motivation for this PR?
The motivation is to improve test debuggability by adding detailed failure reasons in assertions for selected test cases. This enhancement makes it easier to identify the root cause of test failures in logs, thereby reducing triage time and simplifying test maintenance.

How did you do it?
I updated the assertion statements in the following test files to include descriptive error messages:
tests/gnmi/test_gnmi_countersdb.py
tests/snmp/test_snmp_lldp.py

How did you verify/test it?
Verified that the updated assertion messages are correctly reflected in the test code by reviewing the changes locally
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.

5 participants