Skip to content

Commit

Permalink
Adding a CoroutineContext to the Executors to facilitate cancellation…
Browse files Browse the repository at this point in the history
… on timeout.

PiperOrigin-RevId: 605078757
Change-Id: I22bcb452206a2608966921e3306c13413ba54cb4
  • Loading branch information
A Googler authored and copybara-github committed Feb 7, 2024
1 parent d118fb3 commit f2c8f3b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions launcher/launcher.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ def _utp_build_message(ctx):
for (nth, f) in enumerate(ctx.attr.test_fixtures)
]
),
cancellation_config = struct(
plugin_cleanup_timeout_ms = ctx.attr.plugin_cleanup_timeout_ms,
executor_cancellation_timeout_ms = ctx.attr.executor_cancellation_timeout_ms,
executor_cancellation_abort_ms = ctx.attr.executor_cancellation_abort_ms,
),
)
if not ctx.attr.test_fixtures:
message["single_device_executor"] = struct(
Expand Down Expand Up @@ -413,6 +418,18 @@ utp_test = rule(
providers = [[UTPArtifactInfo]],
doc = "android_installable_artifact targets",
),
plugin_cleanup_timeout_ms = attr.int(
default = 1000,
doc = "Time limit to apply to the plugin afterAll phase during cancellation",
),
executor_cancellation_timeout_ms = attr.int(
default = 3000,
doc = "Time limit for test drivers and device providers to clean up gracefully",
),
executor_cancellation_abort_ms = attr.int(
default = 3000,
doc = "Time limit for forcible cleanup after the graceful timeout is exceeded",
),
data = attr.label_list(
allow_files = True,
),
Expand Down

0 comments on commit f2c8f3b

Please sign in to comment.