Possible races in tst_daemon tests.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
online-accounts-api (Ubuntu) |
Fix Released
|
High
|
Alberto Mardegan |
Bug Description
While building online-accounts-api in a silo, I hit test failures on two builds. Here is the yakkety armhf build that failed, and the relevant output:
1468639216.012 getIdentity 35
1468639216.013 getAuthSessionO
1468639216.015 process {"host": "coolmail.ex", "UiPolicy": 2, "delay": 3, "requestorPid": 7466} "user_agent"
FAIL! : FunctionalTests
Loc: [/«BUILDDIR»
And here is the vivid armhf build failure:
1468640752.957 GetConnectionAp
QWARN : FunctionalTests
FAIL! : FunctionalTests
Actual (((accountChang
Expected (1) : 1
Loc: [/«BUILDDIR»
I don't know what caused the failures. I tried updating the assertion in the first case to print the D-Bus error on failure, but the test passed on the next build. There's obviously something going on here, but I don't have time to track it down.
Related branches
- James Henstridge: Approve
-
Diff: 255 lines (+68/-44)3 files modifiedtests/daemon/functional_tests/daemon_interface.cpp (+2/-2)
tests/daemon/functional_tests/daemon_interface.h (+1/-1)
tests/daemon/functional_tests/functional_tests.cpp (+65/-41)
I definitely see how these failures can happen: the tests set the OnlineAccounts. Manager service's auto-termination timeout to 2 seconds, which is generally appropriate. However, the testAccountChan ges() test is not even trying to keep the service alive, because it's modifying the accounts DB via libaccounts; so, on a slower testing machine, indeed the service could auto-terminate itself during the lifetime of the test.
The error in vivid shows exactly this; in the yakkety case, the auto-termination happens a bit later, allowing the testAccountChan ges() test to succeed, but then by the time the next test (testLifetime()) sets up its watch, the OnlineAccounts. Manager service has already quit, causing the other test to fail.