test(worker): add retry and persistence checks and adapt attachment tests for async processing

This commit is contained in:
kk10
2026-11-16 12:41:11 +03:00
parent 4a6176fe81
commit eafc437933
9 changed files with 345 additions and 70 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ func TestAttachmentUploaderFailover(t *testing.T) {
chat := createChat(t, user, user.ID)
original := makePNG(t, 32, 32)
resp := uploadAttachment(t, user, chat.ID, "failover.png", "image/png", original)
requireStatus(t, resp, http.StatusCreated)
requireStatus(t, resp, http.StatusAccepted)
uploader := resp.Header.Get("X-Instance-Id")
var att dto.AttachmentResponse
mustDecode(t, resp, &att)
@@ -82,7 +82,7 @@ func TestAttachmentUploaderFailover(t *testing.T) {
}
return
}
if response.StatusCode != http.StatusBadGateway && response.StatusCode != http.StatusServiceUnavailable && response.StatusCode != http.StatusGatewayTimeout {
if response.StatusCode != http.StatusConflict && response.StatusCode != http.StatusBadGateway && response.StatusCode != http.StatusServiceUnavailable && response.StatusCode != http.StatusGatewayTimeout {
t.Fatalf("unexpected download status: %d", response.StatusCode)
}
}