test: Regenerate GitSSHKey flake when comparing times (#1235)

This is a crazy one! The in-memory DB is fast, which allows the same
exact timestamp to occur for regenerating the key!

See: https://github.com/coder/coder/runs/6234173911?check_suite_focus=true#step:9:82
This commit is contained in:
Kyle Carberry
2022-04-29 20:19:16 -05:00
committed by GitHub
parent 81577f120a
commit e15566c7fa

View File

@ -70,7 +70,7 @@ func TestGitSSHKey(t *testing.T) {
require.NotEmpty(t, key1.PublicKey)
key2, err := client.RegenerateGitSSHKey(ctx, res.UserID)
require.NoError(t, err)
require.Greater(t, key2.UpdatedAt, key1.UpdatedAt)
require.GreaterOrEqual(t, key2.UpdatedAt, key1.UpdatedAt)
require.NotEmpty(t, key2.PublicKey)
require.NotEqual(t, key2.PublicKey, key1.PublicKey)
})