(aconn)
| 200 | @pytest.mark.slow |
| 201 | @pytest.mark.timing |
| 202 | async def test_notifies_blocking(aconn): |
| 203 | async def listener(): |
| 204 | async for _ in aconn.notifies(timeout=1): |
| 205 | pass |
| 206 | |
| 207 | worker = spawn(listener) |
| 208 | try: |
| 209 | # Make sure the listener is listening |
| 210 | if not aconn.lock.locked(): |
| 211 | await asleep(0.01) |
| 212 | |
| 213 | t0 = time() |
| 214 | await aconn.execute("select 1") |
| 215 | dt = time() - t0 |
| 216 | finally: |
| 217 | await gather(worker) |
| 218 | |
| 219 | assert dt > 0.5 |
| 220 | |
| 221 | |
| 222 | @pytest.mark.slow |