[test] Semi-automatic flaky test tracking (#30638)

* [test] Semi-automatic flaky test tracking

* fix

* Automated change: Fix sanity tests

* Update update_flakes.py

* fix formatting

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
pull/30667/head
Craig Tiller 2 years ago committed by GitHub
parent fedba4654d
commit f573fd44f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      build_autogenerated.yaml
  2. 1
      test/core/client_channel/resolvers/BUILD
  3. 168
      test/core/end2end/flaky.bzl
  4. 8
      test/core/end2end/generate_tests.bzl
  5. 1
      test/core/event_engine/posix/BUILD
  6. 1
      test/core/fling/BUILD
  7. 1
      test/core/gprpp/BUILD
  8. 1
      test/core/handshake/BUILD
  9. 1
      test/core/http/BUILD
  10. 2
      test/core/iomgr/BUILD
  11. 1
      test/core/memory_usage/BUILD
  12. 1
      test/core/promise/BUILD
  13. 1
      test/core/resource_quota/BUILD
  14. 2
      test/core/security/BUILD
  15. 2
      test/core/surface/BUILD
  16. 1
      test/core/transport/binder/end2end/BUILD
  17. 2
      test/core/transport/chttp2/BUILD
  18. 1
      test/core/tsi/alts/handshaker/BUILD
  19. 1
      test/cpp/common/BUILD
  20. 6
      test/cpp/end2end/BUILD
  21. 4
      test/cpp/end2end/xds/BUILD
  22. 1
      test/cpp/ext/filters/census/BUILD
  23. 2
      test/cpp/microbenchmarks/BUILD
  24. 1
      test/cpp/server/load_reporter/BUILD
  25. 1
      test/cpp/util/BUILD
  26. 14
      tools/distrib/fix_build_deps.py
  27. 30
      tools/distrib/run_buildozer.py
  28. 102
      tools/distrib/update_flakes.py
  29. 147
      tools/distrib/update_flakes_query.py
  30. 520
      tools/run_tests/generated/tests.json

@ -3419,6 +3419,7 @@ targets:
- mac
- name: fling_stream_test
build: test
run: false
language: c
headers:
- test/core/end2end/data/ssl_test_data.h
@ -3659,6 +3660,7 @@ targets:
- name: activity_test
gtest: true
build: test
run: false
language: c++
headers:
- src/core/lib/gprpp/atomic_utils.h
@ -3831,6 +3833,7 @@ targets:
- name: alts_concurrent_connectivity_test
gtest: true
build: test
run: false
language: c++
headers:
- test/core/end2end/cq_verifier.h
@ -5033,6 +5036,7 @@ targets:
- name: client_interceptors_end2end_test
gtest: true
build: test
run: false
language: c++
headers:
- test/cpp/end2end/interceptors_util.h
@ -5078,6 +5082,7 @@ targets:
- name: client_ssl_test
gtest: true
build: test
run: false
language: c++
headers: []
src:
@ -5148,6 +5153,7 @@ targets:
- name: combiner_test
gtest: true
build: test
run: false
language: c++
headers:
- test/core/util/cmdline.h
@ -5197,7 +5203,6 @@ targets:
- name: completion_queue_threading_test
gtest: true
build: test
run: false
language: c++
headers: []
src:
@ -5405,6 +5410,7 @@ targets:
- name: dns_resolver_cooldown_test
gtest: true
build: test
run: false
language: c++
headers: []
src:
@ -5445,6 +5451,7 @@ targets:
- name: end2end_binder_transport_test
gtest: true
build: test
run: false
language: c++
headers:
- test/core/transport/binder/end2end/fake_binder.h
@ -5758,6 +5765,7 @@ targets:
- name: event_poller_posix_test
gtest: true
build: test
run: false
language: c++
headers:
- src/core/lib/event_engine/posix_engine/ev_epoll1_linux.h
@ -6704,6 +6712,7 @@ targets:
- name: grpc_tls_certificate_provider_test
gtest: true
build: test
run: false
language: c++
headers:
- test/core/util/cmdline.h
@ -7166,6 +7175,7 @@ targets:
- name: httpscli_test
gtest: true
build: test
run: false
language: c++
headers:
- test/core/http/httpcli_test_util.h
@ -8055,6 +8065,7 @@ targets:
- name: orca_service_end2end_test
gtest: true
build: test
run: false
language: c++
headers: []
src:
@ -8181,6 +8192,7 @@ targets:
- name: periodic_update_test
gtest: true
build: test
run: false
language: c++
headers:
- src/core/ext/upb-generated/google/protobuf/any.upb.h
@ -8908,6 +8920,7 @@ targets:
- name: rls_end2end_test
gtest: true
build: test
run: false
language: c++
headers:
- test/core/util/test_lb_policies.h
@ -8958,6 +8971,7 @@ targets:
- name: secure_endpoint_test
gtest: true
build: test
run: false
language: c++
headers:
- test/core/iomgr/endpoint_tests.h
@ -9046,7 +9060,6 @@ targets:
- name: sequential_connectivity_test
gtest: true
build: test
run: false
language: c++
headers: []
src:
@ -9322,7 +9335,6 @@ targets:
- name: settings_timeout_test
gtest: true
build: test
run: false
language: c++
headers:
- test/core/util/cmdline.h
@ -9638,6 +9650,7 @@ targets:
- name: stranded_event_test
gtest: true
build: test
run: false
language: c++
headers:
- test/core/end2end/cq_verifier.h
@ -10248,6 +10261,7 @@ targets:
- name: timer_test
gtest: true
build: test
run: false
language: c++
headers: []
src:
@ -10327,6 +10341,7 @@ targets:
- name: too_many_pings_test
gtest: true
build: test
run: false
language: c++
headers:
- test/core/end2end/cq_verifier.h
@ -10822,6 +10837,7 @@ targets:
- name: work_serializer_test
gtest: true
build: test
run: false
language: c++
headers: []
src:
@ -11013,6 +11029,7 @@ targets:
- name: xds_core_end2end_test
gtest: true
build: test
run: false
language: c++
headers:
- test/cpp/end2end/counted_service.h
@ -11240,6 +11257,7 @@ targets:
- name: xds_fault_injection_end2end_test
gtest: true
build: test
run: false
language: c++
headers:
- test/cpp/end2end/counted_service.h
@ -11383,6 +11401,7 @@ targets:
- name: xds_outlier_detection_end2end_test
gtest: true
build: test
run: false
language: c++
headers:
- test/cpp/end2end/counted_service.h
@ -11500,6 +11519,7 @@ targets:
- name: xds_rls_end2end_test
gtest: true
build: test
run: false
language: c++
headers:
- test/cpp/end2end/counted_service.h

@ -49,6 +49,7 @@ grpc_cc_test(
name = "dns_resolver_cooldown_test",
srcs = ["dns_resolver_cooldown_test.cc"],
external_deps = ["gtest"],
flaky = True,
language = "C++",
deps = [
"//:gpr",

@ -0,0 +1,168 @@
# Copyright 2022 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""A list of flaky tests, consumed by generate_tests.bzl to set flaky attrs."""
FLAKY_TESTS = [
"h2_census_test@bad_ping",
"h2_census_test@grpc_authz",
"h2_census_test@retry_per_attempt_recv_timeout",
"h2_census_test@retry_too_many_attempts",
"h2_census_test@retry_transparent_mcs",
"h2_census_test@shutdown_finishes_calls",
"h2_compress_test@grpc_authz",
"h2_compress_test@keepalive_timeout",
"h2_compress_test@max_connection_age",
"h2_compress_test@max_connection_idle",
"h2_compress_test@retry_cancellation",
"h2_fakesec_test@retry_per_attempt_recv_timeout",
"h2_fakesec_test@retry_server_pushback_disabled",
"h2_fakesec_test@retry_too_many_attempts",
"h2_fakesec_test@shutdown_finishes_calls",
"h2_fd_test@max_connection_age",
"h2_full+pipe_test@max_connection_idle",
"h2_full_no_retry_test@bad_ping",
"h2_full_no_retry_test@grpc_authz",
"h2_full_no_retry_test@hpack_size",
"h2_full_no_retry_test@max_connection_age",
"h2_full_no_retry_test@max_connection_idle",
"h2_full_test@bad_ping",
"h2_full_test@keepalive_timeout",
"h2_full_test@max_connection_age",
"h2_full_test@max_connection_idle",
"h2_full_test@retry_per_attempt_recv_timeout",
"h2_full_test@retry_recv_trailing_metadata_error",
"h2_full_test@retry_send_initial_metadata_refs",
"h2_full_test@retry_server_pushback_delay",
"h2_http_proxy_test@compressed_payload",
"h2_http_proxy_test@connectivity",
"h2_http_proxy_test@grpc_authz",
"h2_http_proxy_test@hpack_size",
"h2_http_proxy_test@max_connection_age",
"h2_http_proxy_test@max_connection_idle",
"h2_http_proxy_test@ping_pong_streaming",
"h2_http_proxy_test@retry_per_attempt_recv_timeout",
"h2_insecure_test@bad_ping",
"h2_insecure_test@grpc_authz",
"h2_insecure_test@max_connection_age",
"h2_insecure_test@max_connection_idle",
"h2_insecure_test@retry",
"h2_insecure_test@retry_send_initial_metadata_refs",
"h2_insecure_test@retry_server_pushback_disabled",
"h2_local_abstract_uds_percent_encoded_test@max_connection_idle",
"h2_local_ipv4_test@bad_ping",
"h2_local_ipv4_test@max_connection_idle",
"h2_local_ipv4_test@retry",
"h2_local_ipv4_test@retry_per_attempt_recv_timeout",
"h2_local_ipv4_test@retry_send_initial_metadata_refs",
"h2_local_ipv4_test@retry_streaming2",
"h2_local_ipv6_test@bad_ping",
"h2_local_ipv6_test@cancel_after_accept",
"h2_local_ipv6_test@max_connection_idle",
"h2_local_ipv6_test@retry_per_attempt_recv_timeout",
"h2_local_ipv6_test@retry_server_pushback_disabled",
"h2_local_ipv6_test@shutdown_finishes_calls",
"h2_local_uds_percent_encoded_test@bad_ping",
"h2_local_uds_percent_encoded_test@connectivity",
"h2_local_uds_percent_encoded_test@max_connection_idle",
"h2_local_uds_percent_encoded_test@retry_per_attempt_recv_timeout",
"h2_local_uds_percent_encoded_test@retry_streaming2",
"h2_local_uds_percent_encoded_test@retry_transparent_mcs",
"h2_local_uds_test@bad_ping",
"h2_local_uds_test@grpc_authz",
"h2_local_uds_test@max_connection_age",
"h2_local_uds_test@max_connection_idle",
"h2_local_uds_test@retry_server_pushback_disabled",
"h2_oauth2_test@bad_ping",
"h2_oauth2_test@connectivity",
"h2_oauth2_test@filter_context",
"h2_oauth2_test@grpc_authz",
"h2_oauth2_test@max_connection_age",
"h2_oauth2_test@max_connection_idle",
"h2_oauth2_test@retry_server_pushback_delay",
"h2_oauth2_test@retry_server_pushback_disabled",
"h2_oauth2_test@retry_too_many_attempts",
"h2_proxy_test@grpc_authz",
"h2_proxy_test@retry_send_initial_metadata_refs",
"h2_proxy_test@shutdown_finishes_calls",
"h2_sockpair_1byte_test@max_connection_age",
"h2_sockpair_1byte_test@shutdown_finishes_calls",
"h2_sockpair_test@grpc_authz",
"h2_sockpair_test@max_connection_age",
"h2_ssl_cred_reload_test@bad_ping",
"h2_ssl_cred_reload_test@client_streaming",
"h2_ssl_cred_reload_test@connectivity",
"h2_ssl_cred_reload_test@max_connection_idle",
"h2_ssl_cred_reload_test@retry",
"h2_ssl_cred_reload_test@retry_per_attempt_recv_timeout",
"h2_ssl_cred_reload_test@retry_server_pushback_delay",
"h2_ssl_cred_reload_test@retry_too_many_attempts",
"h2_ssl_cred_reload_test@simple_delayed_request",
"h2_ssl_proxy_test@disappearing_server",
"h2_ssl_proxy_test@retry_cancellation",
"h2_ssl_proxy_test@retry_server_pushback_delay",
"h2_ssl_proxy_test@retry_too_many_attempts",
"h2_ssl_proxy_test@shutdown_finishes_calls",
"h2_ssl_test@bad_ping",
"h2_ssl_test@compressed_payload",
"h2_ssl_test@grpc_authz",
"h2_ssl_test@max_connection_idle",
"h2_ssl_test@retry",
"h2_ssl_test@retry_cancellation",
"h2_ssl_test@retry_per_attempt_recv_timeout",
"h2_ssl_test@retry_send_initial_metadata_refs",
"h2_ssl_test@retry_server_pushback_disabled",
"h2_ssl_test@retry_too_many_attempts",
"h2_ssl_test@shutdown_finishes_calls",
"h2_tls_certwatch_async_tls1_3_test@cancel_after_invoke",
"h2_tls_certwatch_async_tls1_3_test@connectivity",
"h2_tls_certwatch_async_tls1_3_test@max_connection_idle",
"h2_tls_certwatch_async_tls1_3_test@retry_cancellation",
"h2_tls_certwatch_async_tls1_3_test@retry_streaming",
"h2_tls_certwatch_async_tls1_3_test@retry_streaming2",
"h2_tls_certwatch_async_tls1_3_test@simple_delayed_request",
"h2_tls_certwatch_sync_tls1_2_test@connectivity",
"h2_tls_certwatch_sync_tls1_2_test@max_connection_idle",
"h2_tls_certwatch_sync_tls1_2_test@retry_cancellation",
"h2_tls_certwatch_sync_tls1_2_test@retry_server_pushback_delay",
"h2_tls_certwatch_sync_tls1_2_test@simple_delayed_request",
"h2_tls_certwatch_sync_tls1_2_test@write_buffering",
"h2_tls_simple_test@bad_ping",
"h2_tls_simple_test@connectivity",
"h2_tls_simple_test@max_connection_idle",
"h2_tls_simple_test@retry_per_attempt_recv_timeout",
"h2_tls_simple_test@simple_delayed_request",
"h2_tls_static_async_tls1_3_test@connectivity",
"h2_tls_static_async_tls1_3_test@max_connection_idle",
"h2_tls_static_async_tls1_3_test@retry_cancellation",
"h2_tls_static_async_tls1_3_test@retry_per_attempt_recv_timeout",
"h2_tls_static_async_tls1_3_test@simple_delayed_request",
"h2_tls_test@bad_ping",
"h2_tls_test@connectivity",
"h2_tls_test@grpc_authz",
"h2_tls_test@hpack_size",
"h2_tls_test@invoke_large_request",
"h2_tls_test@keepalive_timeout",
"h2_tls_test@max_connection_idle",
"h2_tls_test@resource_quota_server",
"h2_tls_test@retry",
"h2_tls_test@retry_cancellation",
"h2_tls_test@retry_per_attempt_recv_timeout",
"h2_tls_test@retry_streaming",
"h2_tls_test@retry_streaming2",
"h2_tls_test@simple_delayed_request",
"h2_uds_test@bad_ping",
"h2_uds_test@max_connection_idle",
"h2_uds_test@retry_per_attempt_recv_timeout",
"h2_uds_test@retry_streaming",
"h2_uds_test@retry_transparent_mcs",
]

@ -20,6 +20,7 @@ load(
"grpc_cc_library",
"grpc_sh_test",
)
load("flaky.bzl", "FLAKY_TESTS")
def _fixture_options(
fullstack = True,
@ -37,7 +38,6 @@ def _fixture_options(
client_channel = True,
supports_msvc = True,
supports_retry = None,
flaky_tests = [],
tags = []):
if supports_retry == None:
supports_retry = client_channel
@ -56,7 +56,6 @@ def _fixture_options(
client_channel = client_channel,
supports_msvc = supports_msvc,
_platforms = _platforms,
flaky_tests = flaky_tests,
supports_retry = supports_retry,
tags = tags,
)
@ -466,14 +465,15 @@ def grpc_end2end_tests():
if not _compatible(fopt, topt):
continue
test_short_name = str(t) if not topt.short_name else topt.short_name
name = "%s_test@%s" % (f, test_short_name)
grpc_sh_test(
name = "%s_test@%s" % (f, test_short_name),
name = name,
srcs = ["run.sh"],
data = [":" + bin_name],
args = ["$(location %s)" % bin_name, t],
tags = _platform_support_tags(fopt) + fopt.tags + [
"no_test_ios",
],
flaky = t in fopt.flaky_tests,
flaky = name in FLAKY_TESTS,
exclude_pollers = topt.exclude_pollers,
)

@ -50,6 +50,7 @@ grpc_cc_test(
name = "event_poller_posix_test",
srcs = ["event_poller_posix_test.cc"],
external_deps = ["gtest"],
flaky = True,
language = "C++",
tags = [
"no_windows",

@ -74,6 +74,7 @@ grpc_cc_test(
":fling_client",
":fling_server",
],
flaky = True,
tags = [
"no_windows",
"requires-net:ipv4",

@ -377,6 +377,7 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True,
language = "C++",
shard_count = 5,
tags = [

@ -27,6 +27,7 @@ grpc_cc_test(
"//src/core/tsi/test_creds:server1.pem",
],
external_deps = ["gtest"],
flaky = True,
language = "C++",
tags = ["no_windows"],
deps = [

@ -108,6 +108,7 @@ grpc_cc_test(
"//src/core/tsi/test_creds:server1.pem",
],
external_deps = ["gtest"],
flaky = True,
language = "C++",
tags = ["no_windows"],
deps = [

@ -44,6 +44,7 @@ grpc_cc_test(
srcs = ["combiner_test.cc"],
exec_properties = LARGE_MACHINE,
external_deps = ["gtest"],
flaky = True,
language = "C++",
tags = ["no_windows"], # LARGE_MACHINE is not configured for windows RBE
deps = [
@ -343,6 +344,7 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True,
language = "C++",
tags = [
# TODO(apolcyn): This test is failing on Windows at entry, enable once passing.

@ -151,6 +151,7 @@ grpc_cc_test(
"absl/flags:flag",
"absl/flags:parse",
],
flaky = True,
language = "C++",
tags = [
"bazel_only",

@ -228,6 +228,7 @@ grpc_cc_test(
name = "activity_test",
srcs = ["activity_test.cc"],
external_deps = ["gtest"],
flaky = True,
language = "c++",
uses_event_engine = False,
uses_polling = False,

@ -69,6 +69,7 @@ grpc_cc_test(
"absl/memory",
"gtest",
],
flaky = True,
language = "c++",
uses_event_engine = False,
uses_polling = False,

@ -166,6 +166,7 @@ grpc_cc_test(
name = "secure_endpoint_test",
srcs = ["secure_endpoint_test.cc"],
external_deps = ["gtest"],
flaky = True,
language = "C++",
deps = [
"//:gpr",
@ -404,6 +405,7 @@ grpc_cc_test(
"//src/core/tsi/test_creds:server1.pem",
],
external_deps = ["gtest"],
flaky = True,
language = "C++",
deps = [
"//:gpr",

@ -48,7 +48,6 @@ grpc_cc_test(
name = "completion_queue_threading_test",
srcs = ["completion_queue_threading_test.cc"],
external_deps = ["gtest"],
flaky = True, # TODO(b/153064668)
language = "C++",
deps = [
"//:gpr",
@ -146,7 +145,6 @@ grpc_cc_test(
"//src/core/tsi/test_creds:server1.pem",
],
external_deps = ["gtest"],
flaky = True, # TODO(b/151696318)
language = "C++",
deps = [
"//:gpr",

@ -79,6 +79,7 @@ grpc_cc_test(
"absl/time",
"gtest",
],
flaky = True,
language = "C++",
tags = [
# Flaky on windows

@ -210,7 +210,6 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True, # TODO(b/148399919)
language = "C++",
deps = [
"//:gpr",
@ -225,6 +224,7 @@ grpc_cc_test(
timeout = "long", # Required for internal test infrastructure (cl/325757166)
srcs = ["too_many_pings_test.cc"],
external_deps = ["gtest"],
flaky = True,
shard_count = 7,
deps = [
"//:gpr",

@ -81,6 +81,7 @@ grpc_cc_test(
"alts_concurrent_connectivity_test.cc",
],
external_deps = ["gtest"],
flaky = True,
language = "C++",
# TODO(apolcyn): make the fake TCP server used in this
# test portable to Windows.

@ -38,6 +38,7 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True,
deps = [
"//:grpc++",
"//test/core/util:grpc_test_util",

@ -124,6 +124,7 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True,
tags = [
"no_test_android", # android_cc_test doesn't work with data dependency.
"no_test_ios",
@ -150,7 +151,6 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True, # TODO(b/161828686)
tags = [
"no_test_android", # android_cc_test doesn't work with data dependency.
"no_test_ios",
@ -234,6 +234,7 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True,
deps = [
":interceptors_util",
":test_service_impl",
@ -512,6 +513,7 @@ grpc_cc_test(
"gtest",
"absl/types:optional",
],
flaky = True,
tags = ["no_test_ios"],
deps = [
":counted_service",
@ -687,6 +689,7 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True,
tags = [
"no_test_ios",
"no_windows",
@ -937,6 +940,7 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True,
deps = [
"//:grpc++",
"//:grpcpp_orca_service",

@ -202,6 +202,7 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True,
linkstatic = True, # Fixes dyld error on MacOS
shard_count = 15,
tags = [
@ -250,6 +251,7 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True,
linkstatic = True, # Fixes dyld error on MacOS
shard_count = 5,
tags = [
@ -276,6 +278,7 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True,
linkstatic = True, # Fixes dyld error on MacOS
tags = [
"no_test_ios",
@ -330,6 +333,7 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True,
linkstatic = True, # Fixes dyld error on MacOS
tags = [
"no_test_ios",

@ -29,6 +29,7 @@ grpc_cc_test(
"opencensus-tags",
"opencensus-with-tag-map",
],
flaky = True,
language = "C++",
linkstatic = True,
tags = ["no_windows"], # TODO(jtattermusch): fix test on windows

@ -205,6 +205,7 @@ grpc_cc_test(
"bm_fullstack_streaming_ping_pong.cc",
],
args = grpc_benchmark_args(),
flaky = True,
tags = [
"no_mac", # to emulate "excluded_poll_engines: poll"
"no_windows",
@ -250,6 +251,7 @@ grpc_cc_test(
"bm_fullstack_unary_ping_pong.cc",
],
args = grpc_benchmark_args(),
flaky = True,
tags = [
"no_mac", # to emulate "excluded_poll_engines: poll"
"no_windows",

@ -37,6 +37,7 @@ grpc_cc_test(
"gtest",
"opencensus-stats-test",
],
flaky = True,
tags = ["no_windows"],
deps = [
"//:gpr",

@ -359,6 +359,7 @@ grpc_cc_test(
external_deps = [
"gtest",
],
flaky = True,
tags = [
"no_mac", # cmake does not build channelz_sampler in Basic Tests C/C++ MacOS test
"no_test_android", # android_cc_test doesn't work with data dependency.

@ -20,9 +20,9 @@ from doctest import SKIP
import multiprocessing
import os
import re
import subprocess
import sys
import tempfile
import run_buildozer
# find our home
ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
@ -628,15 +628,7 @@ for library, lib_error, deps, external_deps in updated_libraries:
buildozer_set_list('external_deps', external_deps, library, via='deps')
buildozer_set_list('deps', deps, library)
if buildozer_commands:
ok_statuses = (0, 3)
temp = tempfile.NamedTemporaryFile()
open(temp.name, 'w').write('\n'.join(buildozer_commands))
c = ['tools/distrib/buildozer.sh', '-f', temp.name]
r = subprocess.call(c)
if r not in ok_statuses:
print('{} failed with status {}'.format(c, r))
sys.exit(1)
run_buildozer.run_buildozer(buildozer_commands)
if error:
sys.exit(1)

@ -0,0 +1,30 @@
# Copyright 2022 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import subprocess
import sys
import tempfile
def run_buildozer(buildozer_commands):
if not buildozer_commands:
return
ok_statuses = (0, 3)
temp = tempfile.NamedTemporaryFile()
open(temp.name, 'w').write('\n'.join(buildozer_commands))
c = ['tools/distrib/buildozer.sh', '-f', temp.name]
r = subprocess.call(c)
if r not in ok_statuses:
print('{} failed with status {}'.format(c, r))
sys.exit(1)

@ -0,0 +1,102 @@
#!/usr/bin/env python3
# Copyright 2022 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import re
import subprocess
import sys
from google.cloud import bigquery
import run_buildozer
import update_flakes_query
lookback_hours = 24 * 7 * 4
def include_test(test):
if '@' in test:
return False
if test.startswith("//test/cpp/qps:"):
return False
return True
TEST_DIRS = ['test/core', 'test/cpp']
tests = {}
already_flaky = set()
for test_dir in TEST_DIRS:
for line in subprocess.check_output(
['bazel', 'query', 'tests({}/...)'.format(test_dir)]).splitlines():
test = line.strip().decode('utf-8')
if not include_test(test):
continue
tests[test] = False
for test_dir in TEST_DIRS:
for line in subprocess.check_output(
['bazel', 'query',
'attr(flaky, 1, tests({}/...))'.format(test_dir)]).splitlines():
test = line.strip().decode('utf-8')
if not include_test(test):
continue
already_flaky.add(test)
flaky_e2e = set()
client = bigquery.Client()
for row in client.query(
update_flakes_query.QUERY.format(
lookback_hours=lookback_hours)).result():
if row.test_binary not in tests:
m = re.match(r'^//test/core/end2end:([^@]*)@([^@]*)(.*)',
row.test_binary)
if m:
flaky_e2e.add('{}@{}{}'.format(m.group(1), m.group(2), m.group(3)))
print("will mark end2end test {} as flaky".format(row.test_binary))
else:
print("skip obsolete test {}".format(row.test_binary))
continue
print("will mark {} as flaky".format(row.test_binary))
tests[row.test_binary] = True
buildozer_commands = []
for test, flaky in sorted(tests.items()):
if flaky:
buildozer_commands.append('set flaky True|{}'.format(test))
elif test in already_flaky:
buildozer_commands.append('remove flaky|{}'.format(test))
with open('test/core/end2end/flaky.bzl', 'w') as f:
with open(sys.argv[0]) as my_source:
for line in my_source:
if line[0] != '#':
break
for line in my_source:
if line[0] == '#':
print(line.strip(), file=f)
break
for line in my_source:
if line[0] != '#':
break
print(line.strip(), file=f)
print(
"\"\"\"A list of flaky tests, consumed by generate_tests.bzl to set flaky attrs.\"\"\"",
file=f)
print("FLAKY_TESTS = [", file=f)
for line in sorted(list(flaky_e2e)):
print(" \"{}\",".format(line), file=f)
print("]", file=f)
run_buildozer.run_buildozer(buildozer_commands)

@ -0,0 +1,147 @@
# Copyright 2022 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
QUERY = """
#standardSQL
-- See https://console.cloud.google.com/bigquery?sq=830293263384:5a8549832dfb48d9b2c04312a4ae3181 for the original query
WITH
runs AS (
SELECT
RTRIM(LTRIM(REGEXP_REPLACE(test_target, r'(@poller=.+)', ''))) AS test_binary,
REGEXP_EXTRACT(test_target, r'poller=(\w+)') AS poll_strategy,
job_name,
test_target,
test_class_name,
CASE
# in case of timeout / retry / segfault the "test_case" fields will contain weird stuff
# e.g. "test_shard2_run0_attempt0" or "shard_2/20"
# when aggregating, we want to display all of these as a single category of problems
WHEN test_case like 'test_shard_%_run%_attempt%' THEN 'CANNOT_DETERMINE'
WHEN test_case like '%shard_%/%' THEN 'CANNOT_DETERMINE'
# when test_case looks suspiciously like test_target
# its value is probably meaningless and it means that the entire target has failed
# e.g. test_target="//test/cpp/client:destroy_grpclb_channel_with_active_connect_stress_test" and test_case="test/cpp/client/destroy_grpclb_channel_with_active_connect_stress_test.exe"
WHEN STRPOS(test_case, REPLACE(SUBSTR(test_target, 3), ":", "/")) != 0 THEN 'CANNOT_DETERMINE'
ELSE test_case
END AS test_case,
result,
build_id,
timestamp
FROM
`grpc-testing.jenkins_test_results.rbe_test_results`
WHERE
DATETIME_DIFF(CURRENT_DATETIME(),
dateTIME(timestamp),
HOUR) < {lookback_hours}
),
results_counts_per_build AS (
SELECT
test_binary,
#test_target, # aggregate data over all pollers
test_class_name,
test_case,
SUM(SAFE_CAST(result != 'PASSED'
AND result != 'SKIPPED' AS INT64)) AS runs_failed,
SUM(SAFE_CAST(result != 'SKIPPED' AS INT64)) AS runs_total,
job_name,
build_id
FROM
runs
GROUP BY
test_binary,
test_class_name,
test_case,
job_name,
build_id),
builds_with_missing_cannot_determine_testcase_entry AS (
SELECT
test_binary,
job_name,
build_id,
FROM
results_counts_per_build
GROUP BY
test_binary,
job_name,
build_id
HAVING COUNTIF(test_case = 'CANNOT_DETERMINE') = 0
),
# for each test target and build, generate a fake entry with "CANNOT_DETERMINE" test_case
# if not already present.
# this is because in many builds, there will be no "CANNOT_DETERMINE" entry
# and we want to avoid skewing the statistics
results_counts_per_build_with_fake_cannot_determine_test_case_entries AS (
(SELECT * FROM results_counts_per_build)
UNION ALL
(SELECT
test_binary,
'' AS test_class_name, # when test_case is 'CANNOT_DETERMINE', test class is empty string
'CANNOT_DETERMINE' AS test_case, # see table "runs"
0 AS runs_failed,
1 AS runs_total,
job_name,
build_id
FROM
builds_with_missing_cannot_determine_testcase_entry)
),
results_counts AS (
SELECT
test_binary,
test_class_name,
test_case,
job_name,
SUM(runs_failed) AS runs_failed,
SUM(runs_total) AS runs_total,
SUM(SAFE_CAST(runs_failed > 0 AS INT64)) AS builds_failed,
COUNT(build_id) AS builds_total,
STRING_AGG(CASE
WHEN runs_failed > 0 THEN 'X'
ELSE '_' END, ''
ORDER BY
build_id ASC) AS build_failure_pattern,
FORMAT("%T", ARRAY_AGG(build_id
ORDER BY
build_id ASC)) AS builds
FROM
#results_counts_per_build
results_counts_per_build_with_fake_cannot_determine_test_case_entries
GROUP BY
test_binary,
test_class_name,
test_case,
job_name
HAVING
runs_failed > 0)
SELECT
ROUND(100*builds_failed / builds_total, 2) AS pct_builds_failed,
ROUND(100*runs_failed / runs_total, 2) AS pct_runs_failed,
test_binary,
test_class_name,
test_case,
job_name,
build_failure_pattern
FROM
results_counts
ORDER BY
pct_builds_failed DESC
"""

@ -137,28 +137,6 @@
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": false,
"language": "c",
"name": "fling_stream_test",
"platforms": [
"linux",
"mac",
"posix"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -415,30 +393,6 @@
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "activity_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
@ -577,26 +531,6 @@
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "alts_concurrent_connectivity_test",
"platforms": [
"linux",
"posix"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -2011,52 +1945,6 @@
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "client_interceptors_end2end_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "client_ssl_test",
"platforms": [
"linux",
"mac",
"posix"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -2135,7 +2023,8 @@
"ci_platforms": [
"linux",
"mac",
"posix"
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
@ -2143,11 +2032,12 @@
"flaky": false,
"gtest": true,
"language": "c++",
"name": "combiner_test",
"name": "common_closures_test",
"platforms": [
"linux",
"mac",
"posix"
"posix",
"windows"
],
"uses_polling": true
},
@ -2166,7 +2056,7 @@
"flaky": false,
"gtest": true,
"language": "c++",
"name": "common_closures_test",
"name": "completion_queue_threading_test",
"platforms": [
"linux",
"mac",
@ -2485,30 +2375,6 @@
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "dns_resolver_cooldown_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -2581,26 +2447,6 @@
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "end2end_binder_transport_test",
"platforms": [
"linux",
"posix"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -2793,28 +2639,6 @@
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "event_poller_posix_test",
"platforms": [
"linux",
"mac",
"posix"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -3523,30 +3347,6 @@
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "grpc_tls_certificate_provider_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -3947,28 +3747,6 @@
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "httpscli_test",
"platforms": [
"linux",
"mac",
"posix"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -4895,30 +4673,6 @@
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "orca_service_end2end_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -5109,30 +4863,6 @@
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "periodic_update_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
@ -5683,30 +5413,6 @@
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "rls_end2end_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -5794,7 +5500,7 @@
"flaky": false,
"gtest": true,
"language": "c++",
"name": "secure_endpoint_test",
"name": "security_connector_test",
"platforms": [
"linux",
"mac",
@ -5818,14 +5524,14 @@
"flaky": false,
"gtest": true,
"language": "c++",
"name": "security_connector_test",
"name": "seq_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": true
"uses_polling": false
},
{
"args": [],
@ -5842,14 +5548,14 @@
"flaky": false,
"gtest": true,
"language": "c++",
"name": "seq_test",
"name": "sequential_connectivity_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": false
"uses_polling": true
},
{
"args": [],
@ -6179,6 +5885,30 @@
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "settings_timeout_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -6605,28 +6335,6 @@
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "stranded_event_test",
"platforms": [
"linux",
"mac",
"posix"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -7315,30 +7023,6 @@
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "timer_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -7435,30 +7119,6 @@
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "too_many_pings_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -7861,28 +7521,6 @@
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "work_serializer_test",
"platforms": [
"linux",
"mac",
"posix"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -7953,28 +7591,6 @@
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "xds_core_end2end_test",
"platforms": [
"linux",
"mac",
"posix"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -8045,28 +7661,6 @@
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "xds_fault_injection_end2end_test",
"platforms": [
"linux",
"mac",
"posix"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
@ -8091,50 +7685,6 @@
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "xds_outlier_detection_end2end_test",
"platforms": [
"linux",
"mac",
"posix"
],
"uses_polling": true
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "xds_rls_end2end_test",
"platforms": [
"linux",
"mac",
"posix"
],
"uses_polling": true
},
{
"args": [],
"boringssl": true,

Loading…
Cancel
Save