D-Bus testing: fix testNoParent

When spawning the dlt daemon under "unbuffer", a lingering tclsh process
exists before the test starts and the test ended up waiting for that to
stop.

We need to be more specific with identifying sync processes: only those
processes started as part of syncing matter.
This commit is contained in:
Patrick Ohly 2014-03-20 06:19:45 -07:00
parent 5066fe2a97
commit ffc0c57402
1 changed files with 4 additions and 1 deletions

View File

@ -4528,6 +4528,8 @@ END:VCARD''')
@property("ENV", "SYNCEVOLUTION_SYNC_DELAY=10") # allow killing syncevo-dbus-server in middle of sync
def testNoParent(self):
"""TestLocalSync.testNoParent - check that sync helper can continue without parent"""
existingProcesses = self.getChildren()
logging.printf('Existing processes: %s', str(existingProcesses))
self.setUpConfigs()
self.setUpListeners(self.sessionpath)
pid = self.serverPid()
@ -4535,7 +4537,8 @@ END:VCARD''')
self.killTimeout = None
self.syncProcesses = {}
def killServer():
self.syncProcesses = self.getChildren()
self.syncProcesses = dict([ (p, props) for p, props in self.getChildren().iteritems() if not existingProcesses.has_key(p)])
logging.printf('Sync processes: %s', str(self.syncProcesses))
if pid != serverPid:
logging.printf('killing syncevo-dbus-server wrapper with pid %d', serverPid)
os.kill(serverPid, signal.SIGKILL)