fix flakey test

since bp2build runs concurrently, errors can occur in any order

Bug: 265845583
Change-Id: Iea6d26bc73112dc89c963545b3e0fc7e1b7fa349
Test: run test localy multiple times
This commit is contained in:
Usta (Tsering) Shrestha
2023-02-13 16:20:51 +00:00
parent 8916b21320
commit 9393264eff

View File

@@ -803,7 +803,6 @@ function test_bp2build_fails_fast {
setup
mkdir -p "a/${GENERATED_BUILD_FILE_NAME}"
touch a/a.txt
cat > a/Android.bp <<EOF
filegroup {
name: "a",
@@ -813,7 +812,6 @@ filegroup {
EOF
mkdir -p "b/${GENERATED_BUILD_FILE_NAME}"
touch b/b.txt
cat > b/Android.bp <<EOF
filegroup {
name: "b",
@@ -826,8 +824,8 @@ EOF
fail "Build should have failed"
fi
grep -q "a/${GENERATED_BUILD_FILE_NAME}' exist" "$MOCK_TOP/errors" || fail "Error for a/${GENERATED_BUILD_FILE_NAME} not found"
grep -q -v "b/${GENERATED_BUILD_FILE_NAME}' exist" "$MOCK_TOP/errors" || fail "Error for b/${GENERATED_BUILD_FILE_NAME} found but not expected"
# we should expect at least one error
grep -q -E "(a|b)/${GENERATED_BUILD_FILE_NAME}' exist" "$MOCK_TOP/errors" || fail "Error for ${GENERATED_BUILD_FILE_NAME} not found"
}
function test_bp2build_back_and_forth_null_build {