@@ -29,24 +29,43 @@ jobs:
2929 curl -L https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > ~/lein
3030 chmod +x ~/lein
3131 ~/lein version
32+ - name : Pre-fetch Go modules
33+ run : |
34+ mkdir -p "$GOCACHE" /tmp/go-tmp
35+ GOPATH=$(go env GOPATH)
36+ export GOCACHE GOTMPDIR=/tmp/go-tmp
37+ go mod download
3238 - name : Run Jepsen unit tests
3339 working-directory : jepsen
3440 run : ~/lein test
3541 - name : Launch demo cluster
3642 run : |
37- mkdir -p "$GOCACHE"
43+ set -euo pipefail
44+ mkdir -p "$GOCACHE" /tmp/go-tmp
45+ export GOTMPDIR=/tmp/go-tmp
3846 nohup go run cmd/server/demo.go > /tmp/elastickv-demo.log 2>&1 &
3947 echo $! > /tmp/elastickv-demo.pid
40- for i in {1..30}; do
41- nc -z 127.0.0.1 63791 && nc -z 127.0.0.1 63792 && nc -z 127.0.0.1 63793 && break
48+
49+ echo "Waiting for redis listeners on 63791-63793..."
50+ for i in {1..90}; do
51+ if nc -z 127.0.0.1 63791 && nc -z 127.0.0.1 63792 && nc -z 127.0.0.1 63793; then
52+ echo "Cluster is up"
53+ exit 0
54+ fi
4255 sleep 1
4356 done
57+
58+ echo "Demo cluster failed to start; dumping log:"
59+ tail -n 200 /tmp/elastickv-demo.log || true
60+ exit 1
4461 - name : Run Redis Jepsen workload against elastickv
4562 working-directory : jepsen
4663 run : |
4764 ~/lein run -m elastickv.redis-workload --time-limit 5 --rate 5 --concurrency 5 --ports 63791,63792,63793 --host 127.0.0.1
4865 - name : Stop demo cluster
4966 run : |
5067 if [ -f /tmp/elastickv-demo.pid ]; then
51- kill "$(cat /tmp/elastickv-demo.pid)" || true
68+ pid=$(cat /tmp/elastickv-demo.pid)
69+ kill "$pid" 2>/dev/null || true
70+ wait "$pid" 2>/dev/null || true
5271 fi
0 commit comments