~ubuntu-branches/ubuntu/trusty/txzookeeper/trusty

« back to all changes in this revision

Viewing changes to txzookeeper/tests/test_conn_failure.py

  • Committer: Package Import Robot
  • Author(s): Clint Byrum, Jakub Wilk, Clint Byrum
  • Date: 2013-05-15 09:58:18 UTC
  • mfrom: (3.2.1) (4.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130515095818-oragqc8jfsc3205x
Tags: 0.9.8-1
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Clint Byrum ]
* New upstream release.
* Updated standards to 3.9.4, no changes necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
        yield watch_d
170
170
 
171
171
    @inlineCallbacks
172
 
    def test_session_exception(self):
173
 
        """Test session expiration.
174
 
 
175
 
        On a single server, the best way to produce a session expiration is
176
 
        timing out the client.
177
 
        """
178
 
        yield self.proxied_client.connect()
179
 
        data = yield self.proxied_client.exists("/")
180
 
        self.assertTrue(data)
181
 
        self.proxy.set_blocked(True)
182
 
        # Wait for session expiration, on a single server options are limited
183
 
        yield self.sleep(15)
184
 
        # Unblock the proxy for next connect, and then drop the connection.
185
 
        self.proxy.set_blocked(False)
186
 
        self.proxy.lose_connection()
187
 
        # Wait for a reconnect (see below why we can't just use a watch here)
188
 
        yield self.sleep(2)
189
 
        yield self.assertFailure(
190
 
            self.proxied_client.get("/a"),
191
 
            zookeeper.SessionExpiredException)
192
 
        self.assertEqual(self.session_events[-1].state_name, "expired")
193
 
 
194
 
    @inlineCallbacks
195
172
    def xtest_binding_bug_session_exception(self):
196
173
        """This test triggers an exception in the python-zookeeper binding.
197
174