You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This starts the services and checks their status. The snap start operation returns once the oneshot setup service exits. These are all operations that are taken care of by snapd. So in a sense, only the successful completion of the oneshot service is being tested here.
What could make this test more useful is to check if the services complete their startup in a reasonable amount of time (by looking for some reference in the logs), or if they fail.
In the above test, we are checking the active status of the snap service for the oneshot service and active services. The test could be updated to also check if each service starts up completely within a reasonable time duration.
The utils.WaitForLogMessage() function could be used here to check compeletion by verifying the log message, with the default 10 seconds duration. If needed, the duration could be increased by passing an argument maxRetry to utils.WaitForLogMessage() as documented there.
The text was updated successfully, but these errors were encountered:
MonicaisHer
changed the title
Improve service startup service to check the completion
Improve service startup test to check the completion
Feb 16, 2024
Originally posted by @farshidtz in #40 (comment)
openthread-border-router-snap/tests/snap_services_test.go
Lines 18 to 25 in 35503fd
In the above test, we are checking the active status of the snap service for the oneshot service and active services. The test could be updated to also check if each service starts up completely within a reasonable time duration.
The
utils.WaitForLogMessage()
function could be used here to check compeletion by verifying the log message, with the default 10 seconds duration. If needed, the duration could be increased by passing an argumentmaxRetry
toutils.WaitForLogMessage()
as documented there.The text was updated successfully, but these errors were encountered: