coder / coder/internal

Flaky test: TestTemplateEdit/Autostop/startRequirement/BlockedNotEntitled

Aperta
#879 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Nessun dato sulla lingua
Stelle
3
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Description

The test `TestTemplateEdit/Autostop/startRequirement/BlockedNotEntitled` is failing consistently across multiple CI runs and platforms (both Linux and macOS runners).

## Test Details

This test verifies that when a user tries to edit template autostop requirements without the proper license entitlement, the operation should fail with a "license is not entitled" error.

The test:
1. Creates a proxy server that returns entitlements without the advanced scheduling feature
2. Attempts to set autostop requirements via the CLI
3. Expects the operation to fail with a license error

## Failure Evidence

- Failed on PR coder/coder#19238 (fix/template-patch-preserve-fields)
- Failed on multiple runners: `test-go-race-pg`, `test-go-pg-17`, `test-go-pg (macos-latest)`
- Error appears to be consistent across different platforms

## Potential Causes

1. **Race condition**: The entitlements check might happen before the proxy server is fully set up
2. **Timing issue**: The client configuration with the proxy might not be properly established
3. **Test isolation**: The test might be affected by other parallel tests

## Suggested Investigation

1. Add more logging to understand the exact failure mode
2. Check if the proxy server is properly intercepting the entitlements request
3. Verify the client is correctly configured to use the proxy
4. Consider adding retry logic or better synchronization in the test setup

## Impact

This flaky test is blocking CI and preventing legitimate changes from being merged. The test failure appears to be unrelated to the actual code changes being tested.

## Related Files

- `/cli/templateedit_test.go` (lines ~338-450)
- `/cli/templateedit.go` (entitlements check logic)

cc: @coder/backend

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia con il caso TestTemplateEdit/Autostop/startRequirement/BlockedNotEntitled in /cli/templateedit_test.go, quindi esamina il controllo degli entitlements in /cli/templateedit.go. Riproducilo negli ambienti CI Linux e macOS elencati e verifica se la configurazione del proxy e quella del client sono pronte prima della richiesta. Il lavoro è completato quando il test rileva in modo affidabile l'errore previsto "license is not entitled" senza bloccare modifiche non correlate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
go
Ambito
testing-qa
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.