[pfcwd]: reduce the number of tested port each day#676
Merged
sihuihan88 merged 1 commit intosonic-net:masterfrom Aug 8, 2018
Merged
[pfcwd]: reduce the number of tested port each day#676sihuihan88 merged 1 commit intosonic-net:masterfrom
sihuihan88 merged 1 commit intosonic-net:masterfrom
Conversation
Signed-off-by: Sihui Han <sihan@microsoft.com>
yxieca
approved these changes
Aug 8, 2018
wangxin
pushed a commit
to wangxin/sonic-mgmt
that referenced
this pull request
Oct 27, 2025
…t#676) <!-- Please make sure you've read and understood our contributing guidelines; https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md Please provide following information to help code review process a bit easier: --> ### Description of PR <!-- - Please include a summary of the change and which issue is fixed. - Please also include relevant motivation and context. Where should reviewer start? background context? - List any dependencies that are required for this change. --> Summary: Fixed nightly test failures in `test_ecn_config_update.py` on some platforms due to invalid new values for `green_min_threshold` or `green_max_threshold` fields. ### Type of change <!-- - Fill x for your type of change. - e.g. - [x] Bug fix --> - [ ] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [x] Test case improvement ### Approach #### What is the motivation for this PR? Nightly test failures in `test_ecn_config_update.py` on some platforms. #### How did you do it? When changing the `green_min_threshold` or `green_max_threshold` field of a WRED profile, we must ensure that the new values are valid. In particular, these conditions should always be true: 1. `green_min_threshold <= green_max_threshold`. 2. `green_max_threshold <= buffer pool size` On some platforms (e.g., Mellanox), `green_max_threshold` must be a multiple of a certain number (unit size). If it is not provided as a multiple of unit size in the config, then SAI rounds-up `green_max_threshold` to the first multiple of unit size. The rounded-up value must still be less than buffer pool size. Otherwise, the ASIC will reject the new value. To ensure these constraints are not violated, we never increase `green_max_threshold`. A new functions named `determine_delta_values` will decide how much each field should change based on fields that are changed in the test and current field values in the WRED profile. #### How did you verify/test it? Ran the tests on a Mellanox device on which the tests previously failed. Here are the test results: ``` generic_config_updater/test_ecn_config_update.py::test_ecn_config_updates[replace-green_min_threshold] PASSED [ 25%] generic_config_updater/test_ecn_config_update.py::test_ecn_config_updates[replace-green_max_threshold] PASSED [ 50%] generic_config_updater/test_ecn_config_update.py::test_ecn_config_updates[replace-green_drop_probability] PASSED [ 75%] generic_config_updater/test_ecn_config_update.py::test_ecn_config_updates[replace-green_min_threshold,green_max_threshold,green_drop_probability] PASSED [100%] ``` #### Any platform specific information? No. The test improvement is generic and applies to all platforms. #### Supported testbed topology if it's a new test case? N/A ### Documentation <!-- (If it's a new feature, new test case) Did you update documentation/Wiki relevant to your implementation? Link to the wiki page? --> N/A --------- Signed-off-by: Mahdi Ramezani <mramezani@microsoft.com>
Pterosaur
pushed a commit
to Pterosaur/sonic-mgmt
that referenced
this pull request
Mar 26, 2026
…t#676) <!-- Please make sure you've read and understood our contributing guidelines; https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md Please provide following information to help code review process a bit easier: --> ### Description of PR <!-- - Please include a summary of the change and which issue is fixed. - Please also include relevant motivation and context. Where should reviewer start? background context? - List any dependencies that are required for this change. --> Summary: Fixed nightly test failures in `test_ecn_config_update.py` on some platforms due to invalid new values for `green_min_threshold` or `green_max_threshold` fields. ### Type of change <!-- - Fill x for your type of change. - e.g. - [x] Bug fix --> - [ ] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [x] Test case improvement ### Approach #### What is the motivation for this PR? Nightly test failures in `test_ecn_config_update.py` on some platforms. #### How did you do it? When changing the `green_min_threshold` or `green_max_threshold` field of a WRED profile, we must ensure that the new values are valid. In particular, these conditions should always be true: 1. `green_min_threshold <= green_max_threshold`. 2. `green_max_threshold <= buffer pool size` On some platforms (e.g., Mellanox), `green_max_threshold` must be a multiple of a certain number (unit size). If it is not provided as a multiple of unit size in the config, then SAI rounds-up `green_max_threshold` to the first multiple of unit size. The rounded-up value must still be less than buffer pool size. Otherwise, the ASIC will reject the new value. To ensure these constraints are not violated, we never increase `green_max_threshold`. A new functions named `determine_delta_values` will decide how much each field should change based on fields that are changed in the test and current field values in the WRED profile. #### How did you verify/test it? Ran the tests on a Mellanox device on which the tests previously failed. Here are the test results: ``` generic_config_updater/test_ecn_config_update.py::test_ecn_config_updates[replace-green_min_threshold] PASSED [ 25%] generic_config_updater/test_ecn_config_update.py::test_ecn_config_updates[replace-green_max_threshold] PASSED [ 50%] generic_config_updater/test_ecn_config_update.py::test_ecn_config_updates[replace-green_drop_probability] PASSED [ 75%] generic_config_updater/test_ecn_config_update.py::test_ecn_config_updates[replace-green_min_threshold,green_max_threshold,green_drop_probability] PASSED [100%] ``` #### Any platform specific information? No. The test improvement is generic and applies to all platforms. #### Supported testbed topology if it's a new test case? N/A ### Documentation <!-- (If it's a new feature, new test case) Did you update documentation/Wiki relevant to your implementation? Link to the wiki page? --> N/A --------- Signed-off-by: Mahdi Ramezani <mramezani@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Sihui Han sihan@microsoft.com
Description of PR
Summary:
Fixes # (issue)
Type of change
Approach
How did you do it?
Reduce the number of tested port each day. It takes hours for platforms that have hundreds of ports.
How did you verify/test it?
Tested on DUT
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation