Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where spark-tests was producing an unintended error code #6009

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

abellina
Copy link
Collaborator

@abellina abellina commented Jul 18, 2022

There was an issue in spark-tests.sh that caused builds to fail, and it is due to a shell expression that conditionally executes using &&. This can produce an error code, demonstrated by this sample:

[[ "bananas" = "apples" ]] && echo "error code set"
echo $?

if [[ "bananas" = "apples" ]]; then
  echo "bad"
fi
echo $?

if [[ "apples" = "apples" ]]; then
  echo "good"
fi
echo $?

This will print 1, 0, 0. Since the script had -e set, the error code is fatal and aborts the job. One solution is to make it an if statement.

Signed-off-by: Alessandro Bellina <abellina@nvidia.com>
@abellina
Copy link
Collaborator Author

build

@sameerz sameerz added the test Only impacts tests label Jul 18, 2022
@sameerz sameerz merged commit 3b1bcbe into NVIDIA:branch-22.08 Jul 18, 2022
@abellina abellina deleted the fix/spark_tests_shell_error branch July 18, 2022 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Only impacts tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants