-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ip/tests_mgmt_ipv6_only.py fails during teardown. #12705
Comments
vivekverma-arista
changed the title
[Bug]: ip/tests_mgmt_ipv6_only.py fails during teardown.
ip/tests_mgmt_ipv6_only.py fails during teardown.
May 3, 2024
@vivekverma-arista Can you attach an output with |
8 tasks
8 tasks
yejianquan
pushed a commit
that referenced
this issue
May 14, 2024
…y cases (#12825) Description of PR This PR is to address the fixture setup sequence issue, and teardown out of sequence issue. In convert_and_restore_config_db_to_ipv6_only, it will do a "config reload -y" during fixture setup or teardown. For feature test cases where config is not saved into config_db.json, this reload needs to be done before feature fixture setup and after feature teardown, such as: tacacs_v6, setup_streaming_telemetry, or setup_ntp. According to https://docs.pytest.org/en/latest/reference/fixtures.html#reference-fixtures, it only considers the following when deciding the fixture orders: scope dependencies autouse We shouldn't use autouse in this test module. So only two options to let convert_and_restore_config_db_to_ipv6_only runs before other fixtures: define other fixtures in 'function' scope. define the feature fixture to request convert_and_restore_config_db_to_ipv6_only explicit. Using option #1 in this PR as the new 'function' scope fixture can be reused by other cases. Option #2 has good readability, but will limit the new fixture to be used by ipv6_only cases. Summary: Fixes #12705 Approach What is the motivation for this PR? Multiple errors were observed in mgmt_ipv6 are related to fixture setup/teardown sequence. How did you do it? Added two 'function' scope fixture: check_tacacs_v6_func and setup_streaming_telemetry_func. And modified 3 tests cases to use 'function' scope fixture. test_ro_user_ipv6_only test_rw_user_ipv6_only test_telemetry_output_ipv6_only co-authorized by: jianquanye@microsoft.com
sdszhang
added a commit
to sdszhang/sonic-mgmt
that referenced
this issue
May 14, 2024
…y cases (sonic-net#12825) Description of PR This PR is to address the fixture setup sequence issue, and teardown out of sequence issue. In convert_and_restore_config_db_to_ipv6_only, it will do a "config reload -y" during fixture setup or teardown. For feature test cases where config is not saved into config_db.json, this reload needs to be done before feature fixture setup and after feature teardown, such as: tacacs_v6, setup_streaming_telemetry, or setup_ntp. According to https://docs.pytest.org/en/latest/reference/fixtures.html#reference-fixtures, it only considers the following when deciding the fixture orders: scope dependencies autouse We shouldn't use autouse in this test module. So only two options to let convert_and_restore_config_db_to_ipv6_only runs before other fixtures: define other fixtures in 'function' scope. define the feature fixture to request convert_and_restore_config_db_to_ipv6_only explicit. Using option sonic-net#1 in this PR as the new 'function' scope fixture can be reused by other cases. Option sonic-net#2 has good readability, but will limit the new fixture to be used by ipv6_only cases. Summary: Fixes sonic-net#12705 Approach What is the motivation for this PR? Multiple errors were observed in mgmt_ipv6 are related to fixture setup/teardown sequence. How did you do it? Added two 'function' scope fixture: check_tacacs_v6_func and setup_streaming_telemetry_func. And modified 3 tests cases to use 'function' scope fixture. test_ro_user_ipv6_only test_rw_user_ipv6_only test_telemetry_output_ipv6_only co-authorized by: jianquanye@microsoft.com
8 tasks
sdszhang
added a commit
to sdszhang/sonic-mgmt
that referenced
this issue
May 14, 2024
…y cases (sonic-net#12825) Description of PR This PR is to address the fixture setup sequence issue, and teardown out of sequence issue. In convert_and_restore_config_db_to_ipv6_only, it will do a "config reload -y" during fixture setup or teardown. For feature test cases where config is not saved into config_db.json, this reload needs to be done before feature fixture setup and after feature teardown, such as: tacacs_v6, setup_streaming_telemetry, or setup_ntp. According to https://docs.pytest.org/en/latest/reference/fixtures.html#reference-fixtures, it only considers the following when deciding the fixture orders: scope dependencies autouse We shouldn't use autouse in this test module. So only two options to let convert_and_restore_config_db_to_ipv6_only runs before other fixtures: define other fixtures in 'function' scope. define the feature fixture to request convert_and_restore_config_db_to_ipv6_only explicit. Using option sonic-net#1 in this PR as the new 'function' scope fixture can be reused by other cases. Option sonic-net#2 has good readability, but will limit the new fixture to be used by ipv6_only cases. Summary: Fixes sonic-net#12705 Approach What is the motivation for this PR? Multiple errors were observed in mgmt_ipv6 are related to fixture setup/teardown sequence. How did you do it? Added two 'function' scope fixture: check_tacacs_v6_func and setup_streaming_telemetry_func. And modified 3 tests cases to use 'function' scope fixture. test_ro_user_ipv6_only test_rw_user_ipv6_only test_telemetry_output_ipv6_only co-authorized by: jianquanye@microsoft.com
8 tasks
yejianquan
pushed a commit
that referenced
this issue
May 15, 2024
…y cases (#12825) (#12845) Description of PR This PR is to address the fixture setup sequence issue, and teardown out of sequence issue. In convert_and_restore_config_db_to_ipv6_only, it will do a "config reload -y" during fixture setup or teardown. For feature test cases where config is not saved into config_db.json, this reload needs to be done before feature fixture setup and after feature teardown, such as: tacacs_v6, setup_streaming_telemetry, or setup_ntp. According to https://docs.pytest.org/en/latest/reference/fixtures.html#reference-fixtures, it only considers the following when deciding the fixture orders: scope dependencies autouse We shouldn't use autouse in this test module. So only two options to let convert_and_restore_config_db_to_ipv6_only runs before other fixtures: define other fixtures in 'function' scope. define the feature fixture to request convert_and_restore_config_db_to_ipv6_only explicit. Using option #1 in this PR as the new 'function' scope fixture can be reused by other cases. Option #2 has good readability, but will limit the new fixture to be used by ipv6_only cases. Summary: Fixes #12705 Approach What is the motivation for this PR? Multiple errors were observed in mgmt_ipv6 are related to fixture setup/teardown sequence. How did you do it? Added two 'function' scope fixture: check_tacacs_v6_func and setup_streaming_telemetry_func. And modified 3 tests cases to use 'function' scope fixture. test_ro_user_ipv6_only test_rw_user_ipv6_only test_telemetry_output_ipv6_only co-authorized by: jianquanye@microsoft.com
yejianquan
pushed a commit
that referenced
this issue
May 15, 2024
…y cases (#12825) (#12846) Description of PR This PR is to address the fixture setup sequence issue, and teardown out of sequence issue. In convert_and_restore_config_db_to_ipv6_only, it will do a "config reload -y" during fixture setup or teardown. For feature test cases where config is not saved into config_db.json, this reload needs to be done before feature fixture setup and after feature teardown, such as: tacacs_v6, setup_streaming_telemetry, or setup_ntp. According to https://docs.pytest.org/en/latest/reference/fixtures.html#reference-fixtures, it only considers the following when deciding the fixture orders: scope dependencies autouse We shouldn't use autouse in this test module. So only two options to let convert_and_restore_config_db_to_ipv6_only runs before other fixtures: define other fixtures in 'function' scope. define the feature fixture to request convert_and_restore_config_db_to_ipv6_only explicit. Using option #1 in this PR as the new 'function' scope fixture can be reused by other cases. Option #2 has good readability, but will limit the new fixture to be used by ipv6_only cases. Summary: Fixes #12705 Approach What is the motivation for this PR? Multiple errors were observed in mgmt_ipv6 are related to fixture setup/teardown sequence. How did you do it? Added two 'function' scope fixture: check_tacacs_v6_func and setup_streaming_telemetry_func. And modified 3 tests cases to use 'function' scope fixture. test_ro_user_ipv6_only test_rw_user_ipv6_only test_telemetry_output_ipv6_only co-authorized by: jianquanye@microsoft.com
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Description
Run
ip/tests_mgmt_ipv6_only.py
.Results you see
Results you expected to see
Test shouldn't fail on teardown. This issue is due to race condition between the fixture teardowns as mentioned in this pull request #12393
Is it platform specific
generic
Relevant log output
Output of
show version
No response
Attach files (if any)
No response
The text was updated successfully, but these errors were encountered: