keep web requests off rebuild path

This commit is contained in:
udo
2026-07-13 12:25:42 +00:00
parent 5195ebeb25
commit 97ecc6edd6
6 changed files with 37 additions and 8 deletions
+20
View File
@@ -11,6 +11,7 @@ if [[ -z "$bin_directory" && -r /etc/uce/settings.cfg ]]; then
fi
bin_directory="${bin_directory:-/tmp/uce/work}"
cache_dir=""
http_host="${UCE_TEST_HTTP_HOST:-uce.openfu.com}"
cleanup() {
rm -rf "$source_dir"
@@ -43,9 +44,28 @@ assert_marker() {
fi
}
http_marker() {
curl -fsS -H "Host: $http_host" "http://127.0.0.1/$test_name/parent.uce"
}
assert_marker parent dependency-marker-a
if [[ "$(http_marker)" != *"dependency-marker-a"* ]]; then
echo "HTTP warm-up did not return dependency-marker-a" >&2
exit 1
fi
sed -i 's/dependency-marker-a/dependency-marker-b/' "$source_dir/child.uce"
started_at=$(date +%s%N)
http_during_rebuild=$(http_marker)
elapsed_ms=$(( ($(date +%s%N) - started_at) / 1000000 ))
if [[ "$http_during_rebuild" != *"dependency-marker-a"* && "$http_during_rebuild" != *"dependency-marker-b"* ]]; then
echo "HTTP rebuild request returned neither complete artifact: $http_during_rebuild" >&2
exit 1
fi
if (( elapsed_ms >= 2000 )); then
echo "HTTP request spent ${elapsed_ms}ms rebuilding a stale artifact" >&2
exit 1
fi
assert_marker parent dependency-marker-b
# A proactive rebuild owns these same per-unit locks. While it publishes fresh