Skip to content

Commit 6b6b972

Browse files
devversionjelbourn
authored andcommitted
build: do not consider e2e test targets as flaky locally (#20371)
Running e2e test targets locally means that Bazel will re-run them a second time if they fail. This slows-down local development as there is no way to see the test failure before Bazel completed the second run. We should not consider e2e tests as flaky locally. Developers could re-run the test themselves if they see it being flaky. Also flaky e2e tests only seem to happen if lots of e2e tests execute concurrently. This is not often the case locally. (cherry picked from commit fd34f35)
1 parent f36890d commit 6b6b972

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

.circleci/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,10 @@ jobs:
244244
- *yarn_install
245245
- *setup_bazel_binary
246246

247-
- run: bazel test src/... --build_tag_filters=e2e --test_tag_filters=e2e --build_tests_only
247+
# Run e2e tests. Note that protractor test targets are flaky sometimes, so we run them
248+
# with flaky test attempts. This means that Bazel will re-run a failed e2e test target
249+
# a second time to ensure it's a real test failure. This improves CI stability.
250+
- run: yarn e2e --flaky_test_attempts=2
248251
- *slack_notify_on_failure
249252

250253
# ------------------------------------------------------------------------------------------

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"test-local": "yarn -s test --local",
2222
"test-firefox": "yarn -s test --firefox",
2323
"lint": "yarn -s tslint && yarn -s stylelint && yarn -s ownerslint && yarn -s ng-dev format changed --check",
24-
"e2e": "bazel test //src/... --test_tag_filters=e2e",
24+
"e2e": "bazel test //src/... --build_tag_filters=e2e --test_tag_filters=e2e --build_tests_only",
2525
"deploy-dev-app": "node ./scripts/deploy-dev-app.js",
2626
"breaking-changes": "ts-node --project scripts/tsconfig.json scripts/breaking-changes.ts",
2727
"gulp": "gulp",

tools/defaults.bzl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,8 @@ def karma_web_test_suite(name, **kwargs):
198198
**kwargs
199199
)
200200

201-
# Protractor web test targets are flaky by default as the browser can sometimes
202-
# crash (e.g. due to too much concurrency). Passing the "flaky" flag ensures that
203-
# Bazel detects flaky tests and re-runs these a second time in case of a flake.
204-
def protractor_web_test_suite(flaky = True, **kwargs):
201+
def protractor_web_test_suite(**kwargs):
205202
_protractor_web_test_suite(
206-
flaky = flaky,
207203
browsers = ["@npm_angular_dev_infra_private//browsers/chromium:chromium"],
208204
**kwargs
209205
)

0 commit comments

Comments
 (0)