Skip to content
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

[202012 platform_tests] TestWatchdogApi::test_remaining_time failure on vms20-t1-7050cx3-3.1 #8440

Closed
sujinmkang opened this issue Aug 11, 2021 · 1 comment · Fixed by #8530
Assignees

Comments

@sujinmkang
Copy link
Collaborator

Description

Lastest 202012 image has sonic-mgmt/tests/platform_tests/api/test_watchdog.py::TestWatchdogApi::test_remaining_time failure on vms20-t1-7050cx3-3.1

Steps to reproduce the issue:

Describe the results you received:

2021-08-10T12:04:31.9713678Z def test_remaining_time(self, duthosts, enum_rand_one_per_hwsku_hostname, platform_api_conn, conf):
2021-08-10T12:04:31.9716763Z ''' arm watchdog with a valid timeout and verify that remaining time API works correctly '''
2021-08-10T12:04:31.9719334Z
2021-08-10T12:04:31.9721866Z watchdog_timeout = conf['valid_timeout']
2021-08-10T12:04:31.9725462Z
2021-08-10T12:04:31.9728442Z # in the begginging of the test watchdog is not armed, so
2021-08-10T12:04:31.9731230Z # get_remaining_time has to return -1
2021-08-10T12:04:31.9733571Z remaining_time = watchdog.get_remaining_time(platform_api_conn)
2021-08-10T12:04:31.9736379Z if self.expect(remaining_time is not None and remaining_time is -1, "watchdog should be disabled in the initial state"):
2021-08-10T12:04:31.9739327Z actual_timeout = watchdog.arm(platform_api_conn, watchdog_timeout)
2021-08-10T12:04:31.9741648Z remaining_time = watchdog.get_remaining_time(platform_api_conn)
2021-08-10T12:04:31.9743787Z
2021-08-10T12:04:31.9746050Z if self.expect(actual_timeout >= watchdog_timeout, "watchdog arm with {} seconds failed".format(watchdog_timeout)):
2021-08-10T12:04:31.9748793Z if self.expect(remaining_time > 0, "Remaining_time {} seconds is not valid".format(remaining_time)):
2021-08-10T12:04:31.9751780Z self.expect(remaining_time <= actual_timeout, "Remaining_time {} seconds should be less than watchdog armed timeout {} seconds".format(remaining_time, actual_timeout))
2021-08-10T12:04:31.9754325Z
2021-08-10T12:04:31.9756676Z remaining_time = watchdog.get_remaining_time(platform_api_conn)
2021-08-10T12:04:31.9759202Z time.sleep(TEST_WAIT_TIME_SECONDS)
2021-08-10T12:04:31.9761703Z remaining_time_new = watchdog.get_remaining_time(platform_api_conn)
2021-08-10T12:04:31.9764761Z self.expect(remaining_time_new < remaining_time, "Remaining_time {} seconds should be decreased from previous remaining_time {} seconds".format(remaining_time_new, remaining_time))
2021-08-10T12:04:31.9767569Z > self.assert_expectations()
2021-08-10T12:04:31.9768522Z
2021-08-10T12:04:31.9771272Z conf = OrderedDict([('valid_timeout', 10), ('greater_timeout', 100), ('too_big_timeout', 660)])
2021-08-10T12:04:31.9773860Z duthosts = <tests.common.devices.duthosts.DutHosts object at 0x7f76b9ad69d0>
2021-08-10T12:04:31.9776389Z enum_rand_one_per_hwsku_hostname = 'str2-7050cx3-acs-03'
2021-08-10T12:04:31.9778900Z platform_api_conn = <httplib.HTTPConnection instance at 0x7f76a268ed70>
2021-08-10T12:04:31.9781094Z remaining_time = 0
2021-08-10T12:04:31.9782998Z remaining_time_new = 0
2021-08-10T12:04:31.9785288Z self = <test_watchdog.TestWatchdogApi object at 0x7f76b9002550>
2021-08-10T12:04:31.9787666Z watchdog_timeout = 10
2021-08-10T12:04:31.9791924Z
2021-08-10T12:04:31.9793935Z platform_tests/api/test_watchdog.py:143:
2021-08-10T12:04:31.9796277Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2021-08-10T12:04:31.9797461Z
2021-08-10T12:04:31.9799610Z self = <test_watchdog.TestWatchdogApi object at 0x7f76b9002550>
2021-08-10T12:04:31.9800608Z
2021-08-10T12:04:31.9802783Z def assert_expectations(self):
2021-08-10T12:04:31.9804934Z """
2021-08-10T12:04:31.9807357Z Checks if there are any error messages waiting in failed_expectations.
2021-08-10T12:04:31.9810072Z If so, it will fail an assert and pass a concatenation of all pending
2021-08-10T12:04:31.9813776Z error messages. It will also clear failed_expectations to prepare it
2021-08-10T12:04:31.9816027Z for the next use.
2021-08-10T12:04:31.9817990Z """
2021-08-10T12:04:31.9820013Z if len(self.failed_expectations) > 0:
2021-08-10T12:04:31.9822147Z err_msg = ", ".join(self.failed_expectations)
2021-08-10T12:04:31.9825153Z # TODO: When we move to Python 3.3+, we can use self.failed_expectations.clear() instead
2021-08-10T12:04:31.9828500Z del self.failed_expectations[:]
2021-08-10T12:04:31.9830626Z > pytest_assert(False, err_msg)
2021-08-10T12:04:31.9833083Z E Failed: watchdog should be disabled in the initial state, Remaining_time 0 seconds should be decreased from previous remaining_time 0 seconds
2021-08-10T12:04:31.9834185Z
2021-08-10T12:04:31.9837252Z err_msg = 'watchdog should be disabled in the initial state, Remaining_time 0 seconds should be decreased from previous remaining_time 0 seconds'
2021-08-10T12:04:31.9840073Z self = <test_watchdog.TestWatchdogApi object at 0x7f76b9002550>

Describe the results you expected:

platform_tests/api/test_watchdog.py::TestWatchdogApi::test_remaining_time[str2-7050cx3-acs-03] SKIPPED or PASSED

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

@Staphylo
Copy link
Collaborator

Our hardware does not have the capability to query remaining time.
On the master branch we ended up implementing a software workaround, but the downside is that it only work from within the same process. If one process monitors while a different one arms the watchdog it won't report accurate information.
I believe we just want to ignore this failure, but I could always cherry-pick our master workaround if you think it's best.

@sujinmkang sujinmkang linked a pull request Aug 20, 2021 that will close this issue
sujinmkang pushed a commit that referenced this issue Aug 20, 2021
Fix Chassis.get_name to return the same value than what's in platform.json
Fix Chassis.get_system_eeprom_info when running from within pmon.
Fix Watchdog.get_remaining_time (fixes [202012 platform_tests] TestWatchdogApi::test_remaining_time failure on vms20-t1-7050cx3-3.1 #8440 and [ 202012 platform_tests ] TestWatchdogApi::test_arm_disarm_states failure on vms20-t1-7050cx3-3.1 #8439)
Implement missing thermal infos and conditions (fixes [202012 platform_tests] test_platform_info.py::test_thermal_control_psu_absence error #8453)
Fix Chassis.set_status_led return value (fixes [2020 platform_tests] TestChassisApi::test_status_led failure on vms20-t0-7050cx3-1  #8464)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants