#!/usr/bin/env bash # #44352 replicate the canary across arms on a clean box. # One local box gave B2 = 0,0,2 and one clean box gave B2 = 6. Neither n is enough # to characterise the fix arm, so this runs the four arms R times in fresh browser # sessions and prints every replicate -- no smoothing, no dropped runs. set -uo pipefail B=https://majorlift-artifacts-share.s3.us-west-1.amazonaws.com/public/metamask/44352/harness S3=s3://majorlift-artifacts-share/public/metamask/44352 R=${R:-6} export DEBIAN_FRONTEND=noninteractive sudo apt-get update -qq >/dev/null 2>&1 sudo apt-get install -y -qq curl xz-utils python3-pip fonts-dejavu-core \ libgtk-3-0t64 libasound2t64 libdbus-glib-1-2 libx11-xcb1 libxtst6 libxt6 >/dev/null 2>&1 pip3 install --break-system-packages -q marionette_driver pillow >/dev/null 2>&1 || true mkdir -p ~/work && cd ~/work curl -sL -o ff.tar.xz "https://ftp.mozilla.org/pub/firefox/releases/153.0/linux-x86_64/en-US/firefox-153.0.tar.xz" tar xf ff.tar.xz export FF_BIN="$PWD/firefox/firefox" for f in measure6.py instruments.py; do curl -sfO "$B/$f"; done echo "#44352 canary replicates -- Firefox 153.0 headless, N=8/arm, fresh session per replicate" echo "each replicate is a separate browser launch; every run is printed" echo "===============================================================================" printf "%-5s %-8s %-8s %-8s %-8s %s\n" rep A2 B2 "P(=8)" "Z(=0)" valid for i in $(seq 1 "$R"); do out=$(SNAP=off N=8 ARMS=A2,B2,P,Z timeout 900 python3 -u instruments.py 2>&1 \ | grep -vE 'Sandbox:|EPERM|^\[|WARNING') a=$(echo "$out" | awk '$1=="A2"{print $2}') b=$(echo "$out" | awk '$1=="B2"{print $2}') p=$(echo "$out" | awk '$1=="P"{print $2}') z=$(echo "$out" | awk '$1=="Z"{print $2}') v=$(echo "$out" | grep -o 'run is [A-Z]*' | awk '{print $3}') printf "%-5s %-8s %-8s %-8s %-8s %s\n" "$i" "$a" "$b" "$p" "$z" "$v" done | tee replicates-clean.txt echo "===============================================================================" aws s3 cp replicates-clean.txt "$S3/replicates-clean.txt" --only-show-errors && echo uploaded