Skip to content

Commit

Permalink
Try printing error state
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Dec 30, 2024
1 parent a716154 commit 432241e
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/ubuntu/exasol.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ sudo tar -xzf EXAplus-24.2.1.tar.gz -C /opt/exasol --strip-comp

# Add to the path.
if [[ -n "$GITHUB_PATH" ]]; then
echo "/opt/exasol" >> $GITHUB_PATH
echo "/opt/exasol" >> "$GITHUB_PATH"
fi
4 changes: 2 additions & 2 deletions .github/ubuntu/firebird.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ if [ -z "$SKIP_DEPENDS" ]; then
fi

# Tell DBD::Firebird where to find the libraries.
if [[ ! -z "$GITHUB_ENV" ]]; then
echo "FIREBIRD_HOME=/usr" >> $GITHUB_ENV
if [[ -n "$GITHUB_ENV" ]]; then
echo "FIREBIRD_HOME=/usr" >> "$GITHUB_ENV"
fi
12 changes: 6 additions & 6 deletions .github/ubuntu/oracle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ bsdtar -C /opt/instantclient --strip-components 1 -zxf "instantclient-basic-linu
bsdtar -C /opt/instantclient --strip-components 1 -zxf "instantclient-sqlplus-linux.x64-${version}.zip"
bsdtar -C /opt/instantclient --strip-components 1 -zxf "instantclient-sdk-linux.x64-${version}.zip"

if [[ ! -z "$GITHUB_PATH" ]]; then
echo "/opt/instantclient" >> $GITHUB_PATH
if [[ -n "$GITHUB_PATH" ]]; then
echo "/opt/instantclient" >> "$GITHUB_PATH"
fi

if [[ ! -z "$GITHUB_ENV" ]]; then
echo "ORACLE_HOME=/opt/instantclient" >> $GITHUB_ENV
if [[ -n "$GITHUB_ENV" ]]; then
echo "ORACLE_HOME=/opt/instantclient" >> "$GITHUB_ENV"
if [[ -z "$LD_LIBRARY_PATH" ]]; then
echo "LD_LIBRARY_PATH=/opt/instantclient" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/instantclient" >> "$GITHUB_ENV"
else
echo "LD_LIBRARY_PATH=/opt/instantclient:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/instantclient:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
fi
fi
4 changes: 2 additions & 2 deletions .github/ubuntu/pg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ curl -O https://salsa.debian.org/postgresql/postgresql-common/-/raw/master/pgdg/
sudo sh apt.postgresql.org.sh -i -t -v $PGVERSION
sudo pg_createcluster --start $PGVERSION test -p 5432 --locale=C -- -A trust -E UTF8

if [[ ! -z "$GITHUB_PATH" ]]; then
echo "/usr/lib/postgresql/$POSTGRES/bin" >> $GITHUB_PATH
if [[ -n "$GITHUB_PATH" ]]; then
echo "/usr/lib/postgresql/$POSTGRES/bin" >> "$GITHUB_PATH"
fi
10 changes: 5 additions & 5 deletions .github/ubuntu/snowflake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ sudo mv /opt/snowflake/ErrorMessages/en-US /opt/snowflake/lib/
# Install, update, and configure SnowSQL.
sed -e '1,/^exit$/d' snowsql.bash | sudo tar -C /opt/snowflake -zxf -
/opt/snowflake/snowsql -Uv
echo "[options]\nnoup = true" > /opt/snowflake/config
printf "[options]\nnoup = true\n" > /opt/snowflake/config

# Add to the path.
if [[ ! -z "$GITHUB_PATH" ]]; then
echo "/opt/snowflake" >> $GITHUB_PATH
if [[ -n "$GITHUB_PATH" ]]; then
echo "/opt/snowflake" >> "$GITHUB_PATH"
fi

# Tell SnowSQL where to find the config.
if [[ ! -z "$GITHUB_ENV" ]]; then
echo "WORKSPACE=/opt/snowflake" >> $GITHUB_ENV
if [[ -n "$GITHUB_ENV" ]]; then
echo "WORKSPACE=/opt/snowflake" >> "$GITHUB_ENV"
fi
14 changes: 7 additions & 7 deletions .github/ubuntu/sqlite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SQLITE=${SQLITE:=${1:-3.40.1}}
echo "Instaling SQLite $SQLITE"

# Convert to the SQLITE_VERSION_NUMBER format https://sqlite.org/c3ref/c_source_id.html
SQLITE=$(perl -e 'my @v = split /[.]/, shift; printf "%d%02d%02d%02d\n", @v[0..3]' $SQLITE)
SQLITE=$(perl -e 'my @v = split /[.]/, shift; printf "%d%02d%02d%02d\n", @v[0..3]' "$SQLITE")

# Since 3.7.16.1, the URL includes the year in the path.
# 3.18.2, 3.18.1, 3.9.3, and 3.7.11 missing.
Expand Down Expand Up @@ -42,20 +42,20 @@ gcc -shared -o libsqlite3.so -fPIC sqlite3.o -ldl -lpthread
# Hand-build DBD::SQLite against the version of SQLite just installed.
DIST=$(cpanm --info DBD::SQLite) # ISHIGAKI/DBD-SQLite-1.70.tar.gz
URL=https://cpan.metacpan.org/authors/id/${DIST:0:1}/${DIST:0:2}/$DIST
curl -o dbd.tar.gz $URL
curl -o dbd.tar.gz "$URL"
tar zxvf dbd.tar.gz --strip-components 1
perl -i -pe 's/^if\s*\(\s*0\s*\)\s\{/if (1) {/' Makefile.PL
perl Makefile.PL SQLITE_INC=/opt/sqlite SQLITE_LIB=/opt/sqlite
make && make install

if [[ ! -z "$GITHUB_PATH" ]]; then
echo "/opt/sqlite" >> $GITHUB_PATH
if [[ -n "$GITHUB_PATH" ]]; then
echo "/opt/sqlite" >> "$GITHUB_PATH"
fi

if [[ ! -z "$GITHUB_ENV" ]]; then
if [[ -n "$GITHUB_ENV" ]]; then
if [[ -z "$LD_LIBRARY_PATH" ]]; then
echo "LD_LIBRARY_PATH=/opt/sqlite" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/sqlite" >> "$GITHUB_ENV"
else
echo "LD_LIBRARY_PATH=/opt/sqlite:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/sqlite:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"
fi
fi
38 changes: 26 additions & 12 deletions t/exasol.t
Original file line number Diff line number Diff line change
Expand Up @@ -417,18 +417,32 @@ $uri = URI->new(
$ENV{EXA_URI} ||
'db:dbadmin:password@localhost/dbadmin'
);
my $err = try {
$exa->use_driver;
$dbh = DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, {
PrintError => 0,
RaiseError => 0,
AutoCommit => 1,
HandleError => $exa->_error_handler,
});
undef;
} catch {
$_;
};
my $err;
for my $i (1..30) {
$err = try {
$exa->use_driver;
$dbh = DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, {
PrintError => 0,
RaiseError => 0,
AutoCommit => 1,
HandleError => $exa->_error_handler,
});
undef;
} catch {
$_;
};

if ($err) {
diag "DBI::state: ", ($DBI::state || ''), "\nMessage: ", $err->message, "\nOrig: ", $err->previous_exception;
last;
}
# Sleep if it failed but Vertica is still starting up.
# SQL-57V03: `failed: FATAL 4149: Node startup/recovery in progress. Not yet ready to accept connections`
# SQL-08001: `failed: [Vertica][DSI] An error occurred while attempting to retrieve the error message for key 'VConnectFailed' and component ID 101: Could not open error message files`
last unless $err && (($DBI::state || '') eq '57V03' || $err->message =~ /VConnectFailed/);
sleep 1 if $i < 30;
}


DBIEngineTest->run(
class => $CLASS,
Expand Down

0 comments on commit 432241e

Please sign in to comment.