@@ -360,23 +360,35 @@ def test_poll_query_until(self):
360
360
check_time = 'select extract(epoch from now()) - {} >= 5'
361
361
362
362
start_time = node .execute ('postgres' , get_time )[0 ][0 ]
363
- node .poll_query_until ('postgres' , check_time .format (start_time ))
363
+ node .poll_query_until (
364
+ dbname = 'postgres' , query = check_time .format (start_time ))
364
365
end_time = node .execute ('postgres' , get_time )[0 ][0 ]
365
366
366
367
self .assertTrue (end_time - start_time >= 5 )
367
368
368
369
# check 0 rows
369
370
with self .assertRaises (QueryException ):
370
371
node .poll_query_until (
371
- 'postgres' , 'select * from pg_class where true = false' )
372
+ dbname = 'postgres' ,
373
+ query = 'select * from pg_class where true = false' )
372
374
373
375
# check 0 columns
374
376
with self .assertRaises (QueryException ):
375
- node .poll_query_until ('postgres' ,
376
- 'select from pg_class limit 1' )
377
- # check None
377
+ node .poll_query_until (
378
+ dbname = 'postgres' , query = 'select from pg_class limit 1' )
379
+ # check None, fail
378
380
with self .assertRaises (QueryException ):
379
- node .poll_query_until ('postgres' , 'create table abc (val int)' )
381
+ node .poll_query_until (
382
+ dbname = 'postgres' , query = 'create table abc (val int)' )
383
+
384
+ # check None, ok
385
+ node .poll_query_until (
386
+ dbname = 'postgres' , query = 'create table def()' ,
387
+ expected = None ) # returns nothing
388
+
389
+ # check arbitrary expected value
390
+ node .poll_query_until (
391
+ dbname = 'postgres' , query = 'select 1' , expected = 1 )
380
392
381
393
# check timeout
382
394
with self .assertRaises (TimeoutException ):
0 commit comments