restore sane repeat count and timeout for objC tests (#30897)

pull/30909/head
Jan Tattermusch 3 years ago committed by GitHub
parent a644d8c9b4
commit 3d7fc93e1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/objective-c/tests/Common/TestUtils.m
  2. 10
      tools/internal_ci/macos/grpc_objc_bazel_test.sh

@ -26,10 +26,10 @@
#define NSStringize(x) @NSStringize_helper(x)
// Default test flake repeat counts
static const NSUInteger kGRPCDefaultTestFlakeRepeats = 2;
static const NSUInteger kGRPCDefaultTestFlakeRepeats = 1;
// Default interop local test timeout.
const NSTimeInterval GRPCInteropTestTimeoutDefault = 3.0;
const NSTimeInterval GRPCInteropTestTimeoutDefault = 15.0;
NSString *GRPCGetLocalInteropTestServerAddressPlainText() {
static NSString *address;
@ -126,6 +126,10 @@ BOOL GRPCTestRunWithFlakeRepeats(XCTestCase *testCase, GRPCTestRunBlock testBloc
if (result == XCTWaiterResultCompleted && assertionSuccess) {
return YES;
}
if (!isLastRun) {
NSLog(@"test attempt %@ failed, will retry.", NSStringize(runs));
}
runs += 1;
}

@ -91,6 +91,12 @@ INTEROP_SERVER_BINARY=bazel-bin/test/cpp/interop/interop_server
trap 'echo "KILLING interop_server binaries running on the background"; kill -9 $(jobs -p)' EXIT
# === END SECTION: run interop_server on the background ====
# Environment variables that will be visible to objc tests.
OBJC_TEST_ENV_ARGS=(
--test_env=HOST_PORT_LOCAL=localhost:$PLAIN_PORT
--test_env=HOST_PORT_LOCALSSL=localhost:$TLS_PORT
)
python3 tools/run_tests/python_utils/bazel_report_helper.py --report_path objc_bazel_tests
# NOTE: When using bazel to run the tests, test env variables like GRPC_VERBOSITY or GRPC_TRACE
@ -103,9 +109,7 @@ objc_bazel_tests/bazel_wrapper \
--google_credentials="${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json" \
"${BAZEL_REMOTE_CACHE_ARGS[@]}" \
$BAZEL_FLAGS \
--test_env HOST_PORT_LOCAL=localhost:$PLAIN_PORT \
--test_env HOST_PORT_LOCALSSL=localhost:$TLS_PORT \
--test_env FLAKE_TEST_REPEATS=3 \
"${OBJC_TEST_ENV_ARGS[@]}" \
-- \
"${EXAMPLE_TARGETS[@]}" \
"${TEST_TARGETS[@]}"

Loading…
Cancel
Save