Bug 54495 - Eavesdropping on replies can sometimes break the tests
Summary: Eavesdropping on replies can sometimes break the tests
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: mission-control (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact: Telepathy bugs list
URL:
Whiteboard: review+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2012-09-04 16:15 UTC by Simon McVittie
Modified: 2012-09-17 14:10 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
servicetest: don't eavesdrop on method replies or errors (2.23 KB, patch)
2012-09-04 16:15 UTC, Simon McVittie
Details | Splinter Review

Description Simon McVittie 2012-09-04 16:15:48 UTC
Created attachment 66610 [details] [review]
servicetest: don't eavesdrop on method replies or errors

Eavesdropping on method replies breaks libdbus if you call methods using the
same connection. You can get into a situation like this:

* Test calls a method on MC; say the serial number is 42
* At around the same time, MC calls a method on gnome-keyring and also uses
  serial number 42
* gnome-keyring replies, labelled "in reply to 42"
* Test is eavesdropping, so it sees the reply going from gnome-keyring to MC
* Test interprets the reply from gnome-keyring to MC as the reply it was
  expecting from MC, sees completely the wrong types, and becomes
  confused

This seems unlikely - but because serial numbers are sequential and
start from 1 for each connection (as opposed to starting from a random
offset), two connections can quite easily happen to sync up. I saw it
happen most recently in the gnome-keyring test. With the benefit
of hindsight, I think I've seen this before: whenever the tests
made an Introspect() call which returned a type other than 's', that
was probably this bug.
 
We never actually generated events for messages other than signals and
method calls, so match those ones specifically, and don't eavesdrop on
replies.
Comment 1 Jonny Lamb 2012-09-07 16:31:33 UTC
If you say so.
Comment 2 Simon McVittie 2012-09-17 14:10:02 UTC
Fixed in git


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.