Commit ed3a8b88 authored by Guido van Rossum's avatar Guido van Rossum

Tests for fallback should open the server with wait=1. (This didn't

work previously, but the combination of wait=1 and fallback mode now
works correctly -- it waits until connected.)

This prevents spurious ClientDisconnected exceptions.
parent 7812454c
...@@ -383,7 +383,7 @@ class ConnectionTests(StorageTestBase.StorageTestBase): ...@@ -383,7 +383,7 @@ class ConnectionTests(StorageTestBase.StorageTestBase):
# Start a read-only server # Start a read-only server
self._startServer(create=0, index=0, read_only=1) self._startServer(create=0, index=0, read_only=1)
# Start a read-only-fallback client # Start a read-only-fallback client
self._storage = self.openClientStorage(wait=0, read_only_fallback=1) self._storage = self.openClientStorage(wait=1, read_only_fallback=1)
# Stores should fail here # Stores should fail here
self.assertRaises(ReadOnlyError, self._dostore) self.assertRaises(ReadOnlyError, self._dostore)
...@@ -398,7 +398,7 @@ class ConnectionTests(StorageTestBase.StorageTestBase): ...@@ -398,7 +398,7 @@ class ConnectionTests(StorageTestBase.StorageTestBase):
# Start a read-only server # Start a read-only server
self._startServer(create=0, index=0, ro_svr=1) self._startServer(create=0, index=0, ro_svr=1)
# Start a read-only-fallback client # Start a read-only-fallback client
self._storage = self.openClientStorage(wait=0, read_only_fallback=1) self._storage = self.openClientStorage(wait=1, read_only_fallback=1)
# Stores should fail here # Stores should fail here
self.assertRaises(ReadOnlyError, self._dostore) self.assertRaises(ReadOnlyError, self._dostore)
...@@ -492,9 +492,7 @@ class ConnectionTests(StorageTestBase.StorageTestBase): ...@@ -492,9 +492,7 @@ class ConnectionTests(StorageTestBase.StorageTestBase):
# Start a read-only server # Start a read-only server
self._startServer(create=0, read_only=1) self._startServer(create=0, read_only=1)
# Start a client in fallback mode # Start a client in fallback mode
self._storage = self.openClientStorage(wait=0, read_only_fallback=1) self._storage = self.openClientStorage(wait=1, read_only_fallback=1)
# Poll until the client is connected
self.pollUp()
# Stores should fail here # Stores should fail here
self.assertRaises(ReadOnlyError, self._dostore) self.assertRaises(ReadOnlyError, self._dostore)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment