From 4e01dae5342ffaa5db7be23160d3e7c3b46b2d73 Mon Sep 17 00:00:00 2001 From: "cursor[bot]" <206951365+cursor[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 10:40:49 -0400 Subject: [PATCH] Fix flaky TestPreparePostForClient/files (#36631) The files subtest polled for post file metadata with assert.Eventually using only a one-second total wait. Under CI load, PreparePostForClient can take longer than that to see persisted file rows, causing intermittent timeouts while the final assert would still pass if given time. Tests-only change. Verified with go test -run '^TestPreparePostForClient$/^files$' -race -count=100 locally. Co-authored-by: Cursor Agent Co-authored-by: Maria A Nunez --- server/channels/app/post_metadata_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/channels/app/post_metadata_test.go b/server/channels/app/post_metadata_test.go index eda92d74326..073319d9201 100644 --- a/server/channels/app/post_metadata_test.go +++ b/server/channels/app/post_metadata_test.go @@ -329,7 +329,7 @@ func TestPreparePostForClient(t *testing.T) { assert.Eventually(t, func() bool { clientPost = th.App.PreparePostForClient(th.Context, post, &model.PreparePostForClientOpts{}) return assert.ObjectsAreEqual([]*model.FileInfo{fileInfo}, clientPost.Metadata.Files) - }, time.Second, 10*time.Millisecond) + }, 10*time.Second, 25*time.Millisecond) assert.Equal(t, []*model.FileInfo{fileInfo}, clientPost.Metadata.Files, "should've populated Files") })