Skip to content

Commit aa0d465

Browse files
authored
Filter death + DynamicShapeUnbound gtests on Android (pytorch#19503)
Differential Revision: D104784946 Pull Request resolved: pytorch#19503
1 parent e25369b commit aa0d465

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

  • shim_et/xplat/executorch/kernels/test

shim_et/xplat/executorch/kernels/test/util.bzl

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,38 @@ def op_test(name, deps = [], kernel_name = "portable", use_kernel_prefix = False
3737

3838
name_prefix = ""
3939
aten_suffix = ""
40+
41+
# On Android, fork() is unavailable so gtest auto-skips death tests
42+
# (*Dies). Filter them out at discovery time so TestInfra stops
43+
# reporting them as perpetually-skipped/failing. See T270699623.
44+
#
45+
# For portable/optimized kernels, *DynamicShapeUnbound tests are also
46+
# filtered because output_resize=false for those kernels, so they
47+
# GTEST_SKIP() at runtime today. For the ATen kernel, output_resize=true
48+
# (see supported_features_def_aten.yaml), so DynamicShapeUnbound tests
49+
# actually run and provide coverage on Android — keep them.
4050
if kernel_name == "aten":
4151
# For aten kernel, we need to use aten specific utils and types
4252
name_prefix = "aten_"
4353
aten_suffix = "_aten"
44-
elif use_kernel_prefix:
45-
name_prefix = kernel_name + "_"
54+
android_gtest_filter = "-*Dies"
55+
else:
56+
if use_kernel_prefix:
57+
name_prefix = kernel_name + "_"
58+
android_gtest_filter = "-*Dies:*DynamicShapeUnbound"
59+
4660
runtime.cxx_test(
4761
name = name_prefix + name,
4862
srcs = [
4963
"{}.cpp".format(name),
5064
],
5165
visibility = ["//executorch/kernels/..."],
66+
env = select({
67+
"ovr_config//os:android": {
68+
"GTEST_FILTER": android_gtest_filter,
69+
},
70+
"DEFAULT": {},
71+
}),
5272
deps = [
5373
"//executorch/runtime/core/exec_aten:lib" + aten_suffix,
5474
"//executorch/runtime/core/exec_aten/testing_util:tensor_util" + aten_suffix,

0 commit comments

Comments
 (0)