Skip to content

Commit bab16ca

Browse files
committed
ExternalConsoleDriver: fix flaky txchunk test
The txchunk test case added in [1] seems to fail occasionally. Fix this this flaky behavior by adding delays between writing and reading bytes, similar to what was being done in the `test_communicate` function added in commit [2]. [1] 5eb9316 ("driver: introduce txchunk argument for console drivers") [2] 69d5c69 ("ExternalConsoleDriver: Add a ConsoleDriver for existing console tools") Signed-off-by: Fabian Pfitzner <f.pfitzner@pengutronix.de>
1 parent bfb6ff2 commit bab16ca

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/test_externalconsoledriver.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ def test_chunking(self, target):
2727
d.txchunk = 2
2828
d.txdelay = 0.01
2929
d.write(data)
30+
time.sleep(0.1)
3031
assert d.read(len(data)) == data # assert written data is read
3132

3233
data = b"odd sized\ndata."
3334
d.write(data)
35+
time.sleep(0.1)
3436
assert d.read(len(data)) == data # assert written data is read
3537

3638
data = b"odd chunk\nsize."
3739
d.txchunk = 3
3840
d.write(data)
41+
time.sleep(0.1)
3942
assert d.read(len(data)) == data # assert written data is read
4043
d.close()

0 commit comments

Comments
 (0)