diff --git a/e2e/console/audit_test.go b/e2e/console/audit_test.go index 65aba0b5e..336e5fea7 100644 --- a/e2e/console/audit_test.go +++ b/e2e/console/audit_test.go @@ -708,7 +708,8 @@ func TestAudit_Timestamps(t *testing.T) { initialCreatedAt := getResult.Node.CreatedAt initialUpdatedAt := getResult.Node.UpdatedAt - time.Sleep(10 * time.Millisecond) + // Wait long enough for timestamp to change (database may have second precision) + time.Sleep(1100 * time.Millisecond) updateQuery := ` mutation UpdateAudit($input: UpdateAuditInput!) { diff --git a/e2e/console/datum_test.go b/e2e/console/datum_test.go index 2b0402de5..251e80204 100644 --- a/e2e/console/datum_test.go +++ b/e2e/console/datum_test.go @@ -677,7 +677,8 @@ func TestDatum_Timestamps(t *testing.T) { initialCreatedAt := getResult.Node.CreatedAt initialUpdatedAt := getResult.Node.UpdatedAt - time.Sleep(10 * time.Millisecond) + // Wait long enough for timestamp to change (database may have second precision) + time.Sleep(1100 * time.Millisecond) updateQuery := ` mutation UpdateDatum($input: UpdateDatumInput!) { diff --git a/e2e/console/document_test.go b/e2e/console/document_test.go index a17f90b27..df1ca5c7e 100644 --- a/e2e/console/document_test.go +++ b/e2e/console/document_test.go @@ -674,7 +674,8 @@ func TestDocument_Timestamps(t *testing.T) { initialCreatedAt := getResult.Node.CreatedAt initialUpdatedAt := getResult.Node.UpdatedAt - time.Sleep(10 * time.Millisecond) + // Wait long enough for timestamp to change (database may have second precision) + time.Sleep(1100 * time.Millisecond) updateQuery := ` mutation UpdateDocument($input: UpdateDocumentInput!) { diff --git a/e2e/console/measure_test.go b/e2e/console/measure_test.go index a66ce28f7..f49a18b7a 100644 --- a/e2e/console/measure_test.go +++ b/e2e/console/measure_test.go @@ -785,8 +785,8 @@ func TestMeasure_Timestamps(t *testing.T) { initialCreatedAt := getResult.Node.CreatedAt initialUpdatedAt := getResult.Node.UpdatedAt - // Wait a bit to ensure timestamp difference - time.Sleep(10 * time.Millisecond) + // Wait long enough for timestamp to change (database may have second precision) + time.Sleep(1100 * time.Millisecond) updateQuery := ` mutation UpdateMeasure($input: UpdateMeasureInput!) { diff --git a/e2e/console/meeting_test.go b/e2e/console/meeting_test.go index a99f0e69a..d005a7579 100644 --- a/e2e/console/meeting_test.go +++ b/e2e/console/meeting_test.go @@ -595,7 +595,8 @@ func TestMeeting_Timestamps(t *testing.T) { initialCreatedAt := getResult.Node.CreatedAt initialUpdatedAt := getResult.Node.UpdatedAt - time.Sleep(10 * time.Millisecond) + // Wait long enough for timestamp to change (database may have second precision) + time.Sleep(1100 * time.Millisecond) updateQuery := ` mutation UpdateMeeting($input: UpdateMeetingInput!) { diff --git a/e2e/console/processing_activity_test.go b/e2e/console/processing_activity_test.go index 7adfdf23f..a9cd67210 100644 --- a/e2e/console/processing_activity_test.go +++ b/e2e/console/processing_activity_test.go @@ -556,7 +556,8 @@ func TestProcessingActivity_Timestamps(t *testing.T) { initialCreatedAt := getResult.Node.CreatedAt initialUpdatedAt := getResult.Node.UpdatedAt - time.Sleep(10 * time.Millisecond) + // Wait long enough for timestamp to change (database may have second precision) + time.Sleep(1100 * time.Millisecond) updateQuery := ` mutation UpdateProcessingActivity($input: UpdateProcessingActivityInput!) { diff --git a/e2e/internal/testutil/assert.go b/e2e/internal/testutil/assert.go index 4a8ccb2cf..a577d9194 100644 --- a/e2e/internal/testutil/assert.go +++ b/e2e/internal/testutil/assert.go @@ -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) {