Something went wrong. Try again.
xburner is an experimental HTTP and gRPC load generator written in Zig.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889#!/bin/shset -eu
ROOT_DIR=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd). "${ROOT_DIR}/scripts/common.sh"xburner_init
WORK_DIR=$(xburner_mktemp_dir http2-transport)READY_H2="${WORK_DIR}/http2.ready"READY_H1="${WORK_DIR}/http1.ready"LOG_H2="${WORK_DIR}/http2.log"LOG_H1="${WORK_DIR}/http1.log"PORT_H2=${XBURNER_HTTP2_PORT:-18447}PORT_H1=${XBURNER_HTTP1_PORT:-18448}H2_WASM="${WORK_DIR}/expect-h2.wasm"H11_WASM="${WORK_DIR}/expect-h11.wasm"FIXTURE_BIN="${WORK_DIR}/http2-fixture-server"
cleanup() { xburner_stop_background_pid "${SERVER_PID_H2:-}" xburner_stop_background_pid "${SERVER_PID_H1:-}"}trap cleanup EXIT INT TERM
if [ "${SKIP_ZIG_BUILD:-0}" != "1" ]; then zig build run -- version >/dev/nullelif [ ! -x "${XBURNER_BIN}" ]; then echo "missing ${XBURNER_BIN}; run zig build run -- version or unset SKIP_ZIG_BUILD" >&2 exit 1fi
if [ "${SKIP_WORKFLOW_WASM_BUILD:-0}" != "1" ]; then sh "${ROOT_DIR}/scripts/build_workflow_wasm.sh" \ "${ROOT_DIR}/testdata/fixtures/http-version-http2.c" \ "${H2_WASM}" sh "${ROOT_DIR}/scripts/build_workflow_wasm.sh" \ "${ROOT_DIR}/testdata/fixtures/http-version-http11.c" \ "${H11_WASM}"fi
# Build once so both fixture launches avoid concurrent cold-cache compilation."${GO_BIN}" build -o "${FIXTURE_BIN}" "${ROOT_DIR}/hacks/http2_fixture_server.go"
"${FIXTURE_BIN}" \ "127.0.0.1:${PORT_H2}" "${READY_H2}" auto >"${LOG_H2}" 2>&1 &SERVER_PID_H2=$!
"${FIXTURE_BIN}" \ "127.0.0.1:${PORT_H1}" "${READY_H1}" http1 >"${LOG_H1}" 2>&1 &SERVER_PID_H1=$!
READY_ATTEMPTS=${XBURNER_HTTP2_READY_ATTEMPTS:-600}READY_SLEEP_SECS=${XBURNER_HTTP2_READY_SLEEP_SECS:-0.1}READY=0
for _ in $(seq 1 "${READY_ATTEMPTS}"); do if [ -s "${READY_H2}" ] && [ -s "${READY_H1}" ]; then READY=1 break fi
if ! kill -0 "${SERVER_PID_H2}" 2>/dev/null || ! kill -0 "${SERVER_PID_H1}" 2>/dev/null; then break fi
sleep "${READY_SLEEP_SECS}"done
if [ "${READY}" -ne 1 ]; then echo "HTTP/2 fixture servers did not become ready" >&2 xburner_print_log_excerpt "HTTP/2 server log:" "${LOG_H2}" xburner_print_log_excerpt "HTTP/1.1 server log:" "${LOG_H1}" exit 1fi
HTTP2_PORT="${PORT_H2}" HTTP2_WASM="${H2_WASM}" \ "${XBURNER_BIN}" run "${ROOT_DIR}/testdata/fixtures/http2-auto.toml" >/dev/null
HTTP2_PORT="${PORT_H1}" HTTP2_WASM="${H11_WASM}" \ "${XBURNER_BIN}" run "${ROOT_DIR}/testdata/fixtures/http2-auto.toml" >/dev/null
HTTP2_PORT="${PORT_H2}" HTTP2_WASM="${H11_WASM}" \ "${XBURNER_BIN}" run "${ROOT_DIR}/testdata/fixtures/http2-http11.toml" >/dev/null
HTTP2_PORT="${PORT_H2}" HTTP2_WASM="${H2_WASM}" \ "${XBURNER_BIN}" run "${ROOT_DIR}/testdata/fixtures/http2-explicit.toml" >/dev/null
echo "http2 transport integration checks passed"