fix: racy JDBC tests (#7678)
* fix: racing JDBC tests The JDBC tests have been flaky since adding additional tests. Use the makefile to build the client to avoid the clients racing. * chore: pre-download JDBC drive in integration test * fix: remove stray lockfilepull/24376/head
parent
2bf867ea0a
commit
f87f4c1869
.circleci
influxdb_iox/tests/jdbc_client
|
@ -271,6 +271,9 @@ jobs:
|
||||||
sudo apt-get install openjdk-11-jdk -y
|
sudo apt-get install openjdk-11-jdk -y
|
||||||
- rust_components
|
- rust_components
|
||||||
- cache_restore
|
- cache_restore
|
||||||
|
- run:
|
||||||
|
name: Download flight-sql-jdbc-driver-10.0.0.jar
|
||||||
|
command: make -C influxdb_iox/tests/jdbc_client flight-sql-jdbc-driver-10.0.0.jar
|
||||||
- run:
|
- run:
|
||||||
name: cargo test -p influxdb2_client
|
name: cargo test -p influxdb2_client
|
||||||
command: cargo test -p influxdb2_client
|
command: cargo test -p influxdb2_client
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
driver_path := org/apache/arrow/flight-sql-jdbc-driver/10.0.0/flight-sql-jdbc-driver-10.0.0.jar
|
||||||
|
driver_file := $(notdir $(driver_path))
|
||||||
|
|
||||||
|
Main.class: Main.java
|
||||||
|
javac Main.java
|
||||||
|
|
||||||
|
$(driver_file): $(driver_file).sha
|
||||||
|
curl -s -L "https://search.maven.org/remotecontent?filepath=$(driver_path)" -o $(driver_file)
|
||||||
|
shasum -c $(driver_file).sha
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f flight-sql-jdbc-driver-10.0.0.jar
|
rm -f $(driver_file)
|
||||||
rm -f Main.class
|
rm -f Main.class
|
||||||
|
|
|
@ -8,24 +8,16 @@
|
||||||
# https://stackoverflow.com/questions/59895/how-do-i-get-the-directory-where-a-bash-script-is-located-from-within-the-script
|
# https://stackoverflow.com/questions/59895/how-do-i-get-the-directory-where-a-bash-script-is-located-from-within-the-script
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
JDBC_DRIVER_URL="https://search.maven.org/remotecontent?filepath=org/apache/arrow/flight-sql-jdbc-driver/10.0.0/flight-sql-jdbc-driver-10.0.0.jar"
|
JDBC_DRIVER="flight-sql-jdbc-driver-10.0.0.jar"
|
||||||
JDBC_DRIVER_PATH="$SCRIPT_DIR/flight-sql-jdbc-driver-10.0.0.jar"
|
|
||||||
|
|
||||||
# download driver if not present
|
# download driver if not present
|
||||||
if [ ! -e "$JDBC_DRIVER_PATH" ]; then
|
make -C $SCRIPT_DIR $JDBC_DRIVER
|
||||||
echo "Downloading JDBC driver from $JDBC_DRIVER_URL"
|
|
||||||
curl -L "$JDBC_DRIVER_URL" --output $JDBC_DRIVER_PATH
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Help track down https://github.com/influxdata/influxdb_iox/issues/6967
|
# Help track down https://github.com/influxdata/influxdb_iox/issues/6967
|
||||||
ls -ltr
|
ls -ltr
|
||||||
|
|
||||||
# Verify the download
|
|
||||||
# To update, run: shasum flight-sql-jdbc-driver-10.0.0.jar > flight-sql-jdbc-driver-10.0.0.jar.sha
|
|
||||||
(cd $SCRIPT_DIR && shasum -c flight-sql-jdbc-driver-10.0.0.jar.sha)
|
|
||||||
|
|
||||||
# Compile
|
# Compile
|
||||||
(cd "$SCRIPT_DIR" && javac Main.java)
|
make -C $SCRIPT_DIR Main.class
|
||||||
|
|
||||||
# Run the code and pass along command line arguments
|
# Run the code and pass along command line arguments
|
||||||
java --add-opens=java.base/java.nio=ALL-UNNAMED -classpath "$SCRIPT_DIR:$JDBC_DRIVER_PATH" Main "$@"
|
java --add-opens=java.base/java.nio=ALL-UNNAMED -classpath "$SCRIPT_DIR:$SCRIPT_DIR/$JDBC_DRIVER" Main "$@"
|
||||||
|
|
Loading…
Reference in New Issue