diff --git a/FirebasePerformance/Tests/Unit/Timer/FPRCounterListTest.m b/FirebasePerformance/Tests/Unit/Timer/FPRCounterListTest.m index d31cd61c6e1..00b2c78d38f 100644 --- a/FirebasePerformance/Tests/Unit/Timer/FPRCounterListTest.m +++ b/FirebasePerformance/Tests/Unit/Timer/FPRCounterListTest.m @@ -29,14 +29,18 @@ + (void)setUp { [super setUp]; FIRPerformance *performance = [FIRPerformance sharedInstance]; [performance setDataCollectionEnabled:YES]; +#ifdef UNSWIZZLE_AVAILABLE [[FPRClient sharedInstance] disableInstrumentation]; +#endif // UNSWIZZLE_AVAILABLE } + (void)tearDown { [super tearDown]; FIRPerformance *performance = [FIRPerformance sharedInstance]; [performance setDataCollectionEnabled:NO]; +#ifdef UNSWIZZLE_AVAILABLE [[FPRClient sharedInstance] disableInstrumentation]; +#endif // UNSWIZZLE_AVAILABLE } /** Validates counterlist object creation. */ diff --git a/scripts/build.sh b/scripts/build.sh index 67e576ac990..15019bd184c 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -110,10 +110,12 @@ source scripts/check_secrets.sh function RunXcodebuild() { echo xcodebuild "$@" - xcbeautify_cmd=(xcbeautify --renderer github-actions) + xcbeautify_cmd=(xcbeautify --renderer github-actions --disable-logging) result=0 - xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" || result=$? + xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" \ + && CheckUnexpectedFailures xcodebuild.log \ + || result=$? if [[ $result == 65 ]]; then ExportLogs "$@" @@ -122,7 +124,9 @@ function RunXcodebuild() { sleep 5 result=0 - xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" || result=$? + xcodebuild "$@" | tee xcodebuild.log | "${xcbeautify_cmd[@]}" \ + && CheckUnexpectedFailures xcodebuild.log \ + || result=$? fi if [[ $result != 0 ]]; then @@ -138,6 +142,15 @@ function ExportLogs() { python "${scripts_dir}/xcresult_logs.py" "$@" } +function CheckUnexpectedFailures() { + local log_file=$1 + + if grep -Eq "[1-9]\d* failures \([1-9]\d* unexpected\)" "$log_file"; then + echo "xcodebuild failed with unexpected failures." 1>&2 + return 65 + fi +} + if [[ "$xcode_major" -lt 15 ]]; then ios_flags=( -sdk 'iphonesimulator'