tls/tests/connection: fix some race conditions
authorDan Winship <danw@gnome.org>
Wed, 13 Feb 2013 18:34:34 +0000 (13:34 -0500)
committerDan Winship <danw@gnome.org>
Wed, 13 Feb 2013 18:34:34 +0000 (13:34 -0500)
commitd67f6e45d7f049ad8dfa52b5b266e0f6661112b3
tree4f741eb9ce34445820e424dadfe890dfd6b08fec
parent73126cc4cf889634fff7ccf708ff17d1ea5e9da2
tls/tests/connection: fix some race conditions

Close the client-side connection cleanly, to avoid a race condition
where the server side might see an unclean close.

In teardown_connection(), loop waiting for objects to be destroyed
rather than just asserting that the ref we hold is the last one; in
some cases, a GTask in another thread may still be holding a reference
on one of the objects for an instant after teardown_connection() is
called.

https://bugzilla.gnome.org/show_bug.cgi?id=693720
tls/tests/connection.c