Skip to content

[pfcwd]: reduce the number of tested port each day#676

Merged
sihuihan88 merged 1 commit intosonic-net:masterfrom
sihuihan88:dev/sihan/seed
Aug 8, 2018
Merged

[pfcwd]: reduce the number of tested port each day#676
sihuihan88 merged 1 commit intosonic-net:masterfrom
sihuihan88:dev/sihan/seed

Conversation

@sihuihan88
Copy link
Copy Markdown
Contributor

Signed-off-by: Sihui Han sihan@microsoft.com

Description of PR

Summary:
Fixes # (issue)

Type of change

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

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

Signed-off-by: Sihui Han <sihan@microsoft.com>
@sihuihan88 sihuihan88 requested a review from yxieca August 8, 2018 22:58
@sihuihan88 sihuihan88 merged commit 86a47ef into sonic-net:master Aug 8, 2018
@sihuihan88 sihuihan88 deleted the dev/sihan/seed branch August 8, 2018 23:55
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants