@@ -360,23 +360,35 @@ def test_poll_query_until(self):
360360 check_time = 'select extract(epoch from now()) - {} >= 5'
361361
362362 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 ))
364365 end_time = node .execute ('postgres' , get_time )[0 ][0 ]
365366
366367 self .assertTrue (end_time - start_time >= 5 )
367368
368369 # check 0 rows
369370 with self .assertRaises (QueryException ):
370371 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' )
372374
373375 # check 0 columns
374376 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
378380 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 )
380392
381393 # check timeout
382394 with self .assertRaises (TimeoutException ):
0 commit comments