From f67cd55af2bd2a17c1190fc615efde3605d9b2fb Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Wed, 20 Nov 2024 14:19:02 +0000 Subject: [PATCH] tests --- test/test_event.py | 5 +++-- test/test_scheduler.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_event.py b/test/test_event.py index 99fc9f5ac..881b18d8a 100644 --- a/test/test_event.py +++ b/test/test_event.py @@ -147,12 +147,13 @@ def on_new_line(self, line, is_full_line): raise exc super(Wait4promptUnicodeError, self).on_new_line(line, is_full_line) + timeout = 0.3 output = "bash\n" dict_output = {'line': u'abcbash', 'matched': u'bash', 'named_groups': {}, 'groups': (), 'time': 0} event = Wait4promptUnicodeError(connection=buffer_connection.moler_connection, prompt="bash", till_occurs_times=1) event._ignore_unicode_errors = False event.raise_unicode = True - event.start(timeout=0.1) + event.start(timeout=timeout) buffer_connection.moler_connection.data_received("abc".encode("utf-8"), datetime.datetime.now()) MolerTest.sleep(0.01) event.raise_unicode = False @@ -164,7 +165,7 @@ def on_new_line(self, line, is_full_line): event = Wait4promptUnicodeError(connection=buffer_connection.moler_connection, prompt="bash", till_occurs_times=1) event._ignore_unicode_errors = True event.raise_unicode = True - event.start(timeout=0.1) + event.start(timeout=timeout) buffer_connection.moler_connection.data_received("abc".encode("utf-8"), datetime.datetime.now()) MolerTest.sleep(0.01) event.raise_unicode = False diff --git a/test/test_scheduler.py b/test/test_scheduler.py index d79534d3a..2e3216d00 100644 --- a/test/test_scheduler.py +++ b/test/test_scheduler.py @@ -79,7 +79,7 @@ def test_2_jobs_concurrently(): job1.cancel() job2.cancel() assert (2 == values_2['number']) - assert (4 == values_1['number']) + assert (4 == values_1['number'] or 5 == values_1['number']) def test_thread_test_job():