forked from mtusi2026/mtusi2026lab5
test(worker): add retry and persistence checks and adapt attachment tests for async processing
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user