Fix flaky e2e timestamp tests
Increase sleep time from 10ms to 1100ms to ensure timestamp precision works consistently across databases with second-level granularity. Strengthen AssertTimestampsOnUpdate to require strictly increasing timestamps instead of allowing equal values. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -74,8 +74,8 @@ func AssertTimestampsOnCreate(t *testing.T, createdAt, updatedAt, beforeCreate t
|
||||
func AssertTimestampsOnUpdate(t *testing.T, createdAt, updatedAt, originalCreatedAt, originalUpdatedAt time.Time) {
|
||||
t.Helper()
|
||||
assert.Equal(t, originalCreatedAt, createdAt, "createdAt should not change on update")
|
||||
assert.True(t, updatedAt.After(originalUpdatedAt) || updatedAt.Equal(originalUpdatedAt),
|
||||
"updatedAt should be >= previous updatedAt")
|
||||
assert.True(t, updatedAt.After(originalUpdatedAt),
|
||||
"updatedAt should be strictly after previous updatedAt")
|
||||
}
|
||||
|
||||
func AssertOptionalStringEqual(t *testing.T, expected, actual *string, fieldName string) {
|
||||
|
||||
Reference in New Issue
Block a user