-
Notifications
You must be signed in to change notification settings - Fork 6
Implement YAML+Jinja2 support, code re-org, remove out-dated functions #264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Changes from 10 commits
c5c11ce
ea83cf4
144df39
32cfb93
1e53cfd
2d5f3ae
f9b3f20
1dca02d
ae0bd27
d20b921
e4802ad
c8f00b8
4ddd390
9fdf15c
aee3597
0f17a4d
80c9e79
a776c1f
f18d0be
f0161f8
1b389b1
62bc5f0
2611a25
99a2780
af2e6ff
641b8f5
5b68bd3
c583350
f6028d2
7b860ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
hagertnl marked this conversation as resolved.
|
|
hagertnl marked this conversation as resolved.
|
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ | |
| # Harness package imports. | ||
| from libraries import apptest | ||
| from libraries.subtest_factory import SubtestFactory | ||
| from fundamental_types.rgt_state import RgtState | ||
| from libraries.rgt_state import RgtState | ||
| from libraries.rgt_loggers import rgt_logger_factory | ||
| from machine_types.machine_factory import MachineFactory | ||
|
|
||
|
|
@@ -262,37 +262,48 @@ def __run_subtests_asynchronously(self): | |
| # Submit futures by means of thread pool. | ||
| with concurrent.futures.ThreadPoolExecutor(max_workers=self.__num_workers) as executor: | ||
| for subtest in self.__app_subtests: | ||
| future = executor.submit(apptest.do_application_tasks, | ||
| # gracefully handle keyboard interrupts in main thread | ||
| try: | ||
| future = executor.submit(apptest.do_application_tasks, | ||
| self.__launch_id, | ||
| subtest, | ||
| self.__tasks, | ||
| self.__stdout_stderr, | ||
| self.__separate_build_stdio, | ||
| self.__reuse_first_build, | ||
| self.__reuse_build_from_id) | ||
| future_to_appname[future] = f'{subtest.getNameOfApplication()}.{subtest.getNameOfSubtest()}' | ||
| future_to_appname[future] = f'{subtest.getNameOfApplication()}.{subtest.getNameOfSubtest()}' | ||
| except KeyboardInterrupt: | ||
| pass | ||
|
|
||
| # Log when all job tasks are initiated. | ||
| for my_future in concurrent.futures.as_completed(future_to_appname): | ||
| # appname is appname.testname, as set above | ||
| appname = future_to_appname[my_future] | ||
|
|
||
| # Check if an exception has been raised | ||
| my_future_exception = my_future.exception() | ||
| if my_future_exception: | ||
| message = "Test {} exception encountered:\n{}".format(appname, my_future_exception) | ||
| self.__myLogger.doCriticalLogging(message) | ||
|
|
||
| subtest_result = my_future.result() | ||
| if subtest_result: | ||
| self.__launched_tests += 1 | ||
| message = "Test {} is launched.\n\n".format(appname) | ||
| self.__myLogger.doErrorLogging(message) | ||
| else: | ||
| self.__failed_tests += 1 | ||
| self.__failed_test_list.append(appname) | ||
| message = "Test {} failed to launch.\n\n".format(appname) | ||
| self.__myLogger.doErrorLogging(message) | ||
| all_finished = False | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unsure of what you are trying to accomplish here. It looks like it would restart the build when there is a keyboard interrupt.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this code block is the main thread. In the main thread, it submits a bunch of tasks to the executor, then waits for each to finish in this for-loop. So what we're doing is keeping the main thread alive so that other build tasks that have been submitted can run. It may be a bit clunky in practice, but it's a clean/explainable result of CTRL+C that I would find helpful to, for example, skip a test that I don't want to run and get to a subsequent test that I would find more interesting. In the future, we could refine handling of CTRL+C to add some rate-limiting for "CTRL+C twice in 5 seconds if you wish to exit), but I don't think we have to worry about that yet. |
||
| while not all_finished: | ||
| # gracefully handle keyboard interrupts in main thread | ||
| try: | ||
| for my_future in concurrent.futures.as_completed(future_to_appname): | ||
| # appname is appname.testname, as set above | ||
| appname = future_to_appname[my_future] | ||
|
|
||
| # Check if an exception has been raised | ||
| my_future_exception = my_future.exception() | ||
| if my_future_exception: | ||
| message = "Test {} exception encountered:\n{}".format(appname, my_future_exception) | ||
| self.__myLogger.doCriticalLogging(message) | ||
|
|
||
| subtest_result = my_future.result() | ||
| if subtest_result: | ||
| self.__launched_tests += 1 | ||
| message = "Test {} is launched.\n\n".format(appname) | ||
| self.__myLogger.doErrorLogging(message) | ||
| else: | ||
| self.__failed_tests += 1 | ||
| self.__failed_test_list.append(appname) | ||
| message = "Test {} failed to launch.\n\n".format(appname) | ||
| self.__myLogger.doErrorLogging(message) | ||
| all_finished = True | ||
| except KeyboardInterrupt: | ||
| pass | ||
|
|
||
| message = "All tests are launched. Yahoo!!" | ||
| self.__myLogger.doInfoLogging(message) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.