1# Syncs of the offline copy start FORGE_MIRROR_MIN_INTERVAL seconds apart at2# least. Builds within it make one sync when it ends, not one each.3. "$(dirname "$0")/../lib.sh"4user dami5repo dami/greet6clone dami dami/greet "$T/w/d"7at "$T/w/d" commit "first"8ok push_as dami "$T/w/d" origin main9build10fake_rclone11export FORGE_MIRROR_DELAY=1 FORGE_MIRROR_MIN_INTERVAL=1512build13synced 114first=$(cat "$FORGE_ROOT/.forge/mirror.last")15build16build17sleep 218[ $(($(date +%s) - first)) -lt 15 ] || fail "the builds took too long to land within the interval"19eq "$(grep -c 'mirror: synced' "$FORGE_ROOT/.forge/mirror.log")" 120synced 221second=$(cat "$FORGE_ROOT/.forge/mirror.last")22[ $((second - first)) -ge 15 ] && [ $((second - first)) -le 18 ] || fail "the second sync started $((second - first))s after the first"23sleep 324eq "$(grep -c 'mirror: synced' "$FORGE_ROOT/.forge/mirror.log")" 2