You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
E2E de limites (ST-07/ST-08) falham fora de UTC #53
Dois testes de packages/backend/test/smoke-test.e2e-spec.ts falham sempre quando rodam localmente, num Mac em America/Sao_Paulo com Postgres 16 em container, e passam na CI (runners do GitHub, UTC):
ST-07 "Soft limit notification › triggers a notification when threshold is exceeded": expect(res.body.triggered).toBeGreaterThan(0) recebe 0 (linha ~299).
ST-08 "Hard limit blocks › returns friendly limit message when block rule is exceeded": espera "You hit your tokens limit" e recebe "OK" (linha ~326).
Reproduzido no main (74badb5 e 5e2530e) e nos PRs #51 e #52, durante o QA Docker e pelo backend-dev. A suspeita é dependência de fuso horário (janela de período calculada no fuso local contra timestamps em UTC) ou de tempo.
Escopo
Reproduzir com TZ=America/Sao_Paulo e com TZ=UTC, e confirmar a causa.
Se o bug estiver no código de períodos e limites (common/utils/period*, notifications), corrigir no código. Se estiver só no teste, tornar o teste determinístico.
Rodar o job de e2e da CI também com TZ=America/Sao_Paulo, para pegar regressões de fuso.
Critérios de aceite
npm run test:e2e passa localmente com e sem TZ=UTC.
Activity
fix(backend): fix limit windows once per request in checkLimits
ci: complete the CI with typecheck, build, image validation and TZ ma…