Skip to content

Reduce occurrences of failed IT builds#17543

Merged
abhishekrb19 merged 5 commits intoapache:masterfrom
GWphua:fix-IT-build-fails
Dec 6, 2024
Merged

Reduce occurrences of failed IT builds#17543
abhishekrb19 merged 5 commits intoapache:masterfrom
GWphua:fix-IT-build-fails

Conversation

@GWphua
Copy link
Copy Markdown
Contributor

@GWphua GWphua commented Dec 6, 2024

Description

Currently, Standard ITS integration tests fail on the command:

RUN APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && rm -f /root/base-setup.sh

We will see the following error logged when this happens:
ERROR: failed to solve: process "/bin/sh -c APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && rm -f /root/base-setup.sh" did not complete successfully: exit code: 4

A brief online search shows that the exit code 4 signifies some network issues, probably due to the wget commands in integration-tests/docker/base-setup.sh. This PR aims to reduce the chances of failing due to these network issues, by rerunning the setup script.


This PR has:

  • been self-reviewed.

@GWphua GWphua changed the title Fix IT build fails Reduce occurrences of failed IT builds Dec 6, 2024
Copy link
Copy Markdown
Contributor

@abhishekrb19 abhishekrb19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Some of the standard ITs that were failing with the following error have not surfaced with this updated logic in at least a few CI retry runs on the PR, so this seems to be helping overall:

ERROR: failed to solve: process "/bin/sh -c APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && rm -f /root/base-setup.sh" did not complete successfully: exit code: 4
Error:  Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
    at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:1000)

Thanks, @GWphua!

@abhishekrb19 abhishekrb19 merged commit f61ec0a into apache:master Dec 6, 2024
RUN APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && rm -f /root/base-setup.sh
ARG SETUP_RETRIES=3
# Retry mechanism for running the setup script up to limit of 3 times.
RUN set -e; \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens to this script in case of error ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It continues running the test even after 3 failed attempts, instead of erroring out:

#7 834.3 Set up script attempt 3/3 failed.


#7 DONE 836.4s

#8 [stage-1  1/21] RUN java -version
#8 0.153 openjdk version "17.0.2" 2022-01-18
#8 0.153 OpenJDK Runtime Environment (build 17.0.2+8-86)
#8 0.153 OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)
#8 DONE 0.2s

#9 [stage-1  2/21] RUN echo "[mysqld]\ncharacter-set-server=utf8\ncollation-server=utf8_bin\n" >> /etc/mysql/my.cnf
#9 DONE 0.2s

#10 [stage-1  3/21] RUN find /var/lib/mysql -type f -exec touch {} ; && /etc/init.d/mysql start       && echo "CREATE USER 'druid'@'%' IDENTIFIED BY 'diurd'; GRANT ALL ON druid.* TO 'druid'@'%'; CREATE database druid DEFAULT CHARACTER SET utf8mb4;" | mysql -u root       && /etc/init.d/mysql stop
#10 0.654 Starting MariaDB database server: mysqld.
#10 1.699 Stopping MariaDB database server: mysqldERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
#10 2.721 .
#10 DONE 2.8s

@adarshsanjeev adarshsanjeev added this to the 32.0.0 milestone Jan 16, 2025
@GWphua GWphua deleted the fix-IT-build-fails branch February 6, 2025 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants