Except when it sometimes shouldn't (e.g. no access) NOTE: Despite our efforts with the flush channel, this is inherently racy when used with parallel tests on the same workspace/app. See assertWorkspaceLastUsedAtUpdated for why this takes a duration instead of a context.
(t testing.TB, details *Details, timeout time.Duration)
| 2487 | // See assertWorkspaceLastUsedAtUpdated for why this takes a duration |
| 2488 | // instead of a context. |
| 2489 | func assertWorkspaceLastUsedAtNotUpdated(t testing.TB, details *Details, timeout time.Duration) { |
| 2490 | t.Helper() |
| 2491 | |
| 2492 | ctx := testutil.Context(t, timeout) |
| 2493 | |
| 2494 | require.NotNil(t, details.Workspace, "can't assert LastUsedAt on a nil workspace!") |
| 2495 | before, err := details.SDKClient.Workspace(ctx, details.Workspace.ID) |
| 2496 | require.NoError(t, err) |
| 2497 | details.FlushStats() |
| 2498 | after, err := details.SDKClient.Workspace(ctx, details.Workspace.ID) |
| 2499 | require.NoError(t, err) |
| 2500 | require.Equal(t, before.LastUsedAt, after.LastUsedAt, "workspace LastUsedAt updated when it should not have been") |
| 2501 | } |
| 2502 | |
| 2503 | func generateBadJWE(t *testing.T, claims interface{}) string { |
| 2504 | t.Helper() |