diff options
| author | 2023-02-13 16:20:51 +0000 | |
|---|---|---|
| committer | 2023-02-13 20:25:12 +0000 | |
| commit | 9393264effc1a0a59261cbb852dc7532e70c892d (patch) | |
| tree | 19f2af5c795c46bc0be30524814a70164637eb40 | |
| parent | 8916b21320969a6de6b5724f0be1ff4346ea1406 (diff) | |
fix flakey test
since bp2build runs concurrently, errors can occur in any order
Bug: 265845583
Change-Id: Iea6d26bc73112dc89c963545b3e0fc7e1b7fa349
Test: run test localy multiple times
| -rwxr-xr-x | tests/bootstrap_test.sh | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/bootstrap_test.sh b/tests/bootstrap_test.sh index f3bad7378..fda5ca086 100755 --- a/tests/bootstrap_test.sh +++ b/tests/bootstrap_test.sh @@ -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 { |