Skip to content

Commit d8abc03

Browse files
committed
Fail testing when test-run fails internally
This commit handles the case when test-run found that some of scheduled tasks were not reported as finished by workers. The old behaviour leads to zero exit code in the case when --force option is not set (looks as the unintended mistake). Now this situation causes a testing fail (non-zero exit code) and it does not matter whether --force option is set. Show list of failed tasks always except the case when it is caused by a keyboard interruption. While we are here clarified and changed related test-run messages. All that is about the situation that should never occur. See #115 for such cases.
1 parent 2b1d5f5 commit d8abc03

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

dispatcher.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,15 @@ def report_undone(self, verbose):
237237
return False
238238
if verbose:
239239
color_stdout(
240-
'The following tasks were dispatched on some worker task '
240+
'[Internal test-run error] '
241+
'The following tasks were dispatched to some worker task '
241242
'queue, but were not reported as done (does not matters '
242243
'success or fail):\n', schema='test_var')
243244
for task_id in undone:
244245
color_stdout('- %s' % yaml.safe_dump(task_id))
245246
else:
246-
color_stdout("Count of didn't processed tasks: %d\n"
247-
% len(undone), schema='test_var')
247+
# Visually continue StatisticsWatcher.print_statistics() output.
248+
color_stdout('* undone: %d\n' % len(undone), schema='test_var')
248249
return True
249250

250251
def wait(self):

test-run.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,20 @@ def main_loop_parallel():
107107
dispatcher.wait_processes()
108108
color_stdout('-' * 81, "\n", schema='separator')
109109
has_failed = dispatcher.statistics.print_statistics()
110-
has_undone = dispatcher.report_undone(verbose=is_force)
110+
has_undone = dispatcher.report_undone(verbose=True)
111111
if has_failed:
112112
return EXIT_FAILED_TEST
113-
if is_force and has_undone:
113+
if has_undone:
114114
return EXIT_NOTDONE_TEST
115115
except KeyboardInterrupt:
116116
color_stdout('-' * 81, "\n", schema='separator')
117117
dispatcher.statistics.print_statistics()
118-
dispatcher.report_undone(verbose=is_force)
118+
dispatcher.report_undone(verbose=False)
119119
raise
120120
except HangError:
121121
color_stdout('-' * 81, "\n", schema='separator')
122122
dispatcher.statistics.print_statistics()
123-
dispatcher.report_undone(verbose=is_force)
123+
dispatcher.report_undone(verbose=True)
124124
return EXIT_HANG
125125
return EXIT_SUCCESS
126126

0 commit comments

Comments
 (0)