mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
fix: use new context after t.Parallel in TestOAuthAppSecrets
c.f. https://coder.com/blog/go-testing-contexts-and-t-parallel fixes flakes like https://github.com/coder/coder/runs/20856469613
This commit is contained in:
@ -271,18 +271,18 @@ func TestOAuthAppSecrets(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}})
|
}})
|
||||||
|
|
||||||
ctx := testutil.Context(t, testutil.WaitLong)
|
topCtx := testutil.Context(t, testutil.WaitLong)
|
||||||
|
|
||||||
// Make some apps.
|
// Make some apps.
|
||||||
//nolint:gocritic // OAauth2 app management requires owner permission.
|
//nolint:gocritic // OAauth2 app management requires owner permission.
|
||||||
app1, err := client.PostOAuth2ProviderApp(ctx, codersdk.PostOAuth2ProviderAppRequest{
|
app1, err := client.PostOAuth2ProviderApp(topCtx, codersdk.PostOAuth2ProviderAppRequest{
|
||||||
Name: "razzle-dazzle",
|
Name: "razzle-dazzle",
|
||||||
CallbackURL: "http://localhost",
|
CallbackURL: "http://localhost",
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
//nolint:gocritic // OAauth2 app management requires owner permission.
|
//nolint:gocritic // OAauth2 app management requires owner permission.
|
||||||
app2, err := client.PostOAuth2ProviderApp(ctx, codersdk.PostOAuth2ProviderAppRequest{
|
app2, err := client.PostOAuth2ProviderApp(topCtx, codersdk.PostOAuth2ProviderAppRequest{
|
||||||
Name: "razzle-dazzle-the-sequel",
|
Name: "razzle-dazzle-the-sequel",
|
||||||
CallbackURL: "http://localhost",
|
CallbackURL: "http://localhost",
|
||||||
})
|
})
|
||||||
@ -290,6 +290,7 @@ func TestOAuthAppSecrets(t *testing.T) {
|
|||||||
|
|
||||||
t.Run("DeleteNonExisting", func(t *testing.T) {
|
t.Run("DeleteNonExisting", func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
ctx := testutil.Context(t, testutil.WaitLong)
|
||||||
|
|
||||||
// Should not be able to create secrets for a non-existent app.
|
// Should not be able to create secrets for a non-existent app.
|
||||||
//nolint:gocritic // OAauth2 app management requires owner permission.
|
//nolint:gocritic // OAauth2 app management requires owner permission.
|
||||||
@ -318,6 +319,7 @@ func TestOAuthAppSecrets(t *testing.T) {
|
|||||||
|
|
||||||
t.Run("OK", func(t *testing.T) {
|
t.Run("OK", func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
ctx := testutil.Context(t, testutil.WaitLong)
|
||||||
|
|
||||||
// No secrets yet.
|
// No secrets yet.
|
||||||
//nolint:gocritic // OAauth2 app management requires owner permission.
|
//nolint:gocritic // OAauth2 app management requires owner permission.
|
||||||
|
Reference in New Issue
Block a user