Merge pull request #9944 from vzakaznikov/fix_00964_live_view_watch_events_heartbeat

Fixing 00964_live_view_watch_events_heartbeat.py test to avoid race condition
This commit is contained in:
alexey-milovidov 2020-04-01 05:14:05 +03:00 committed by GitHub
commit 33daf0b065
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,11 +32,13 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
client1.send('CREATE LIVE VIEW test.lv WITH TIMEOUT AS SELECT sum(a) FROM test.mt')
client1.expect(prompt)
client1.send('WATCH test.lv EVENTS')
client2.send('INSERT INTO test.mt VALUES (1),(2),(3)')
client1.expect('2.*' + end_of_block)
client1.expect('Progress: 2.00 rows.*\)')
client2.send('INSERT INTO test.mt VALUES (1)')
client1.expect('1.*' + end_of_block)
client2.send('INSERT INTO test.mt VALUES (2),(3)')
client1.expect('[23].*' + end_of_block)
client1.expect('Progress: [23]\.00 rows.*\)')
# wait for heartbeat
client1.expect('Progress: 2.00 rows.*\)')
client1.expect('Progress: [23]\.00 rows.*\)')
# send Ctrl-C
client1.send('\x03', eol='')
match = client1.expect('(%s)|([#\$] )' % prompt)