mirror of
https://github.com/verilator/verilator.git
synced 2025-04-12 07:56:53 +00:00
Tests: Fix driver race sometimes missing final log data
This commit is contained in:
parent
579257bc42
commit
87eef36b1c
@ -1693,7 +1693,9 @@ class VlTest:
|
|||||||
|
|
||||||
rawbuf = bytearray(2048)
|
rawbuf = bytearray(2048)
|
||||||
|
|
||||||
while proc.poll() is None:
|
while True:
|
||||||
|
finished = proc.poll()
|
||||||
|
# Need to check readinto once, even after poll "completes"
|
||||||
got = proc.stdout.readinto(rawbuf)
|
got = proc.stdout.readinto(rawbuf)
|
||||||
if got:
|
if got:
|
||||||
data = rawbuf[0:got]
|
data = rawbuf[0:got]
|
||||||
@ -1703,6 +1705,8 @@ class VlTest:
|
|||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
if logfh:
|
if logfh:
|
||||||
logfh.write(data)
|
logfh.write(data)
|
||||||
|
if finished is not None:
|
||||||
|
break
|
||||||
|
|
||||||
if logfh:
|
if logfh:
|
||||||
logfh.close()
|
logfh.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user