mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-03-03 15:45:46 +03:00
Add a small delay to receive notification when testing on busy network.
This commit is contained in:
parent
f2c5d04f39
commit
bbe28ba75f
|
@ -109,6 +109,7 @@ conn.close()
|
||||||
self.autocommit(self.conn)
|
self.autocommit(self.conn)
|
||||||
self.listen('foo')
|
self.listen('foo')
|
||||||
self.notify('foo').communicate()
|
self.notify('foo').communicate()
|
||||||
|
time.sleep(0.1)
|
||||||
self.conn.poll()
|
self.conn.poll()
|
||||||
notify = self.conn.notifies[0]
|
notify = self.conn.notifies[0]
|
||||||
self.assert_(isinstance(notify, psycopg2.extensions.Notify))
|
self.assert_(isinstance(notify, psycopg2.extensions.Notify))
|
||||||
|
@ -117,6 +118,7 @@ conn.close()
|
||||||
self.autocommit(self.conn)
|
self.autocommit(self.conn)
|
||||||
self.listen('foo')
|
self.listen('foo')
|
||||||
pid = int(self.notify('foo').communicate()[0])
|
pid = int(self.notify('foo').communicate()[0])
|
||||||
|
time.sleep(0.1)
|
||||||
self.conn.poll()
|
self.conn.poll()
|
||||||
self.assertEqual(1, len(self.conn.notifies))
|
self.assertEqual(1, len(self.conn.notifies))
|
||||||
notify = self.conn.notifies[0]
|
notify = self.conn.notifies[0]
|
||||||
|
@ -131,6 +133,7 @@ conn.close()
|
||||||
self.autocommit(self.conn)
|
self.autocommit(self.conn)
|
||||||
self.listen('foo')
|
self.listen('foo')
|
||||||
pid = int(self.notify('foo', payload="Hello, world!").communicate()[0])
|
pid = int(self.notify('foo', payload="Hello, world!").communicate()[0])
|
||||||
|
time.sleep(0.1)
|
||||||
self.conn.poll()
|
self.conn.poll()
|
||||||
self.assertEqual(1, len(self.conn.notifies))
|
self.assertEqual(1, len(self.conn.notifies))
|
||||||
notify = self.conn.notifies[0]
|
notify = self.conn.notifies[0]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user