#!/bin/bash

set -euo pipefail

failing_nodes=()

for node in $(dig +short gpu-kraken.zooxlabs.com | sort); do
  echo Running on $node.
  if ! bazel test --config=kraken --kraken_config_url=null --remote_gpu_executor="$node":8080 "$@"; then
    failing_nodes+=("$node")
  fi
done

echo Failing nodes: ${failing_nodes[*]}
