diff --git a/.github/workflows/conformite-doris.yml b/.github/workflows/conformite-doris.yml index 6c902bc..99d6479 100644 --- a/.github/workflows/conformite-doris.yml +++ b/.github/workflows/conformite-doris.yml @@ -45,9 +45,21 @@ jobs: apache/doris:all-in-one-4.1.3 for i in $(seq 1 300); do etat=$(docker inspect -f '{{.State.Health.Status}}' doris) - if [ "$etat" = healthy ]; then echo "Doris prêt (${i} s)"; exit 0; fi + if [ "$etat" = healthy ]; then echo "Doris sain (${i} s)"; break; fi sleep 1 done + # « healthy » ne garantit pas encore un BE inscrit et vivant : la + # première création de table peut échouer (« no available + # backends »). On attend qu'une table de sonde se crée. + sql="docker exec -i doris mysql -uroot -h127.0.0.1 -P9030 -N -B -e" + for i in $(seq 1 180); do + if $sql "CREATE DATABASE IF NOT EXISTS sonde; CREATE TABLE IF NOT EXISTS sonde.t (k INT) DUPLICATE KEY(k) DISTRIBUTED BY HASH(k) BUCKETS 1 PROPERTIES (\"replication_num\" = \"1\"); DROP DATABASE sonde FORCE" 2>/tmp/sonde.err; then + echo "Doris prêt, BE vivant (${i} s de plus)"; exit 0 + fi + sleep 1 + done + cat /tmp/sonde.err + $sql "SHOW BACKENDS" || true docker logs doris | tail -100 echo "::error::Doris n'a pas démarré" && exit 1 diff --git a/tests/test_integration_doris.py b/tests/test_integration_doris.py index 16c279b..3eb0ab8 100644 --- a/tests/test_integration_doris.py +++ b/tests/test_integration_doris.py @@ -44,11 +44,12 @@ def _sql(requete: str) -> list[list[str]]: """Exécute une requête par le client `mysql` ; lignes en colonnes (TSV).""" sortie = subprocess.run( [*shlex.split(SQL), "-N", "-B", "-e", requete], - check=True, capture_output=True, text=True, timeout=60, ) + if sortie.returncode: # l'erreur du serveur (stderr) dans le rapport + raise AssertionError(f"SQL en échec ({sortie.returncode}) : {requete}\n{sortie.stderr}") return [ligne.split("\t") for ligne in sortie.stdout.splitlines() if ligne]