Flaky autostart autopkgtest
Bug #1557958 reported by
Alfonso Sanchez-Beato
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ofono-phonesim (Ubuntu) |
Fix Released
|
Undecided
|
Alfonso Sanchez-Beato |
Bug Description
autostart test has been seen to fail occassionally for i386 architecture on xenial. See attached log.
This happened while executing autopkg tests when landing a new ofono version.
description: | updated |
Changed in ofono-phonesim (Ubuntu): | |
assignee: | nobody → Alfonso Sanchez-Beato (alfonsosanchezbeato) |
status: | New → In Progress |
To post a comment you must log in.
This happens when this part of "autostart" is executed:
service ofono-phonesim stop
assert_in 'running' "`service ofono status`"
When ofono-phonesim service stops, it is supposed to re-start ofono service, and this should happen before the assert_in statement is reached. However, when the test fails it is because ofono daemon re-appears in the system a bit later than expected and the assert statement is executed right before that.
This in turn happens because ofono-phonesim is calling "service ofono start" from a SIGTERM handler triggered by "service ofono-phonesim stop". This is not really working, and systemctl hangs in "service ofono stop" until the ofono-phonesim is actually killed by a timeout. After that, ofono service is finally started but now there is no guarantee of that happening before the call to "service ofono-phonesim stop" returns in the autostart script, as it actually returns with error. Hence the race condition.
Note that the systemctl hang happens always, but some times that makes the script fail and some time it does not.