chore(cli): increase healthcheck timeout in TestSupportbundle (#17291)

Fixes https://github.com/coder/internal/issues/272

* Increases healthcheck timeout in tests. This seems to be the most
usual cause of test failures.
* Adds a non-nilness check before caching a healthcheck report.
* Modifies the HTTP response code to 503 (was 404) when no healthcheck
report is available. 503 seems to be a better indicator of the server
state in this case, whereas 404 could be misinterpreted as a typo in the
healthcheck URL.
This commit is contained in:
Cian Johnston
2025-04-09 09:21:17 +01:00
committed by GitHub
parent 8d122aa4ab
commit a8fbe71a22
3 changed files with 11 additions and 6 deletions
+6 -3
View File
@@ -50,7 +50,8 @@ func TestSupportBundle(t *testing.T) {
secretValue := uuid.NewString()
seedSecretDeploymentOptions(t, &dc, secretValue)
client, db := coderdtest.NewWithDatabase(t, &coderdtest.Options{
DeploymentValues: dc.Values,
DeploymentValues: dc.Values,
HealthcheckTimeout: testutil.WaitSuperLong,
})
owner := coderdtest.CreateFirstUser(t, client)
r := dbfake.WorkspaceBuild(t, db, database.WorkspaceTable{
@@ -113,7 +114,8 @@ func TestSupportBundle(t *testing.T) {
secretValue := uuid.NewString()
seedSecretDeploymentOptions(t, &dc, secretValue)
client := coderdtest.New(t, &coderdtest.Options{
DeploymentValues: dc.Values,
DeploymentValues: dc.Values,
HealthcheckTimeout: testutil.WaitSuperLong,
})
_ = coderdtest.CreateFirstUser(t, client)
@@ -133,7 +135,8 @@ func TestSupportBundle(t *testing.T) {
secretValue := uuid.NewString()
seedSecretDeploymentOptions(t, &dc, secretValue)
client, db := coderdtest.NewWithDatabase(t, &coderdtest.Options{
DeploymentValues: dc.Values,
DeploymentValues: dc.Values,
HealthcheckTimeout: testutil.WaitSuperLong,
})
admin := coderdtest.CreateFirstUser(t, client)
r := dbfake.WorkspaceBuild(t, db, database.WorkspaceTable{