Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(harness): auto-clean dead port-forward PIDs and make tests locale-independent

Alfredo Lopezc9f70ca8eb3a
diff --git a/control-ui/components/__tests__/GovernedTraceSurface.test.tsx b/control-ui/components/__tests__/GovernedTraceSurface.test.tsx
index 1a984cab3..c42569fb9 100644
--- a/control-ui/components/__tests__/GovernedTraceSurface.test.tsx
+++ b/control-ui/components/__tests__/GovernedTraceSurface.test.tsx
@@ -701,7 +701,8 @@ describe('GovernedTraceSurface', () => {
expect(screen.getByText('30-day projection')).toBeInTheDocument()
expect(screen.getByText(/This extrapolates persisted daily patterns/)).toBeInTheDocument()
expect(screen.getByText('Variance rate')).toBeInTheDocument()
- expect(screen.getByText(/33\.33%/)).toBeInTheDocument()
+ // Locale-independent: accept both decimal separators (33.33% and 33,33%).
+ expect(screen.getByText(/33[.,]33%/)).toBeInTheDocument()
expect(screen.getByText('1h')).toBeInTheDocument()
expect(screen.getByText('kube:unallocated')).toBeInTheDocument()
expect(screen.getByText('pricing-export:2026-07-10:cpu')).toBeInTheDocument()
diff --git a/control-ui/lib/__tests__/budgets.test.ts b/control-ui/lib/__tests__/budgets.test.ts
index e3998b377..226227934 100644
--- a/control-ui/lib/__tests__/budgets.test.ts
+++ b/control-ui/lib/__tests__/budgets.test.ts
@@ -56,7 +56,8 @@ describe('formatBudgetScope', () => {
describe('formatBudgetAmount', () => {
it('formats cost amounts with the budget currency', () => {
- expect(formatBudgetAmount(12.5, 'cost', 'USD')).toContain('12.5')
+ // Locale-independent: accept both decimal separators (12.5 and 12,5).
+ expect(formatBudgetAmount(12.5, 'cost', 'USD')).toMatch(/12[.,]5/)
expect(formatBudgetAmount(12.5, 'cost', 'USD')).toMatch(/\$|USD/)
})
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index 6a11d5f01..a7466dcb2 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.654",
+ "version": "0.1.655",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.654",
+ "version": "0.1.655",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/control-ui/package.json b/control-ui/package.json
index 956a113f2..349558be4 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.654",
+ "version": "0.1.655",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",
diff --git a/scripts/minikube/t2-common.sh b/scripts/minikube/t2-common.sh
index 5b3bb32db..999055e55 100755
--- a/scripts/minikube/t2-common.sh
+++ b/scripts/minikube/t2-common.sh
@@ -1100,8 +1100,24 @@ t2_process_check() {
for pid_file in "$T2_PROFILE_ROOT/$T2_PROFILE"/pids/*.pid; do
[ -f "$pid_file" ] || continue
recorded_pid="$(sed -n '1p' "$pid_file" 2>/dev/null || true)"
+ # Auto-clean definitively dead profile-owned PID records instead of
+ # blocking the entire T2 certification. The T0 contract tests and
+ # pre-gate-sync legitimately create port-forwards whose processes
+ # terminate when their parent make exits; leaving stale records
+ # makes every subsequent T2 run fail with PORT_FORWARD_CONFLICT.
+ # A PID that is not running is safe to remove only when the record
+ # still belongs to this exact profile.
if ! pf_owner_validate_pid "$recorded_pid" ||
! t2_pid_file_matches_process "$pid_file" "$recorded_pid"; then
+ if pf_owner_validate_pid "$recorded_pid" &&
+ ! ps -p "$recorded_pid" -o pid= >/dev/null 2>&1; then
+ # The recorded process is definitively dead; clean the stale
+ # record so T2 can start fresh port-forwards.
+ printf '[minikube-t2] auto-cleaned dead port-forward record: %s (pid=%s)\n' \
+ "$pid_file" "$recorded_pid" >&2
+ rm -f -- "$pid_file"
+ continue
+ fi
T2_NEXT_COMMAND='repair the exact profile-owned port-forward record before rerunning T2'
t2_fail PORT_FORWARD_CONFLICT "registered port-forward ownership is stale or invalid: $pid_file"
return 1