forked from dapr/components-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpubsub.go
630 lines (568 loc) · 21.4 KB
/
pubsub.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
/*
Copyright 2021 The Dapr Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package pubsub
import (
"context"
"errors"
"fmt"
"reflect"
"slices"
"sort"
"strconv"
"strings"
"sync"
"testing"
"time"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/dapr/components-contrib/metadata"
"github.com/dapr/components-contrib/pubsub"
"github.com/dapr/components-contrib/tests/conformance/utils"
"github.com/dapr/kit/config"
)
const (
defaultPubsubName = "pubusub"
defaultTopicName = "testTopic"
defaultTopicNameBulk = "testTopicBulk"
defaultMultiTopic1Name = "multiTopic1"
defaultMultiTopic2Name = "multiTopic2"
defaultMessageCount = 10
defaultMaxReadDuration = 60 * time.Second
defaultWaitDurationToPublish = 5 * time.Second
defaultCheckInOrderProcessing = true
defaultMaxBulkCount = 5
defaultMaxBulkAwaitDurationMs = 500
bulkSubStartingKey = 1000
defaultProjectID = "conformance-test-prj"
)
type TestConfig struct {
utils.CommonConfig
PubsubName string `mapstructure:"pubsubName"`
TestTopicName string `mapstructure:"testTopicName"`
TestTopicForBulkSub string `mapstructure:"testTopicForBulkSub"`
TestMultiTopic1Name string `mapstructure:"testMultiTopic1Name"`
TestMultiTopic2Name string `mapstructure:"testMultiTopic2Name"`
PublishMetadata map[string]string `mapstructure:"publishMetadata"`
SubscribeMetadata map[string]string `mapstructure:"subscribeMetadata"`
BulkSubscribeMetadata map[string]string `mapstructure:"bulkSubscribeMetadata"`
MessageCount int `mapstructure:"messageCount"`
MaxReadDuration time.Duration `mapstructure:"maxReadDuration"`
WaitDurationToPublish time.Duration `mapstructure:"waitDurationToPublish"`
CheckInOrderProcessing bool `mapstructure:"checkInOrderProcessing"`
TestProjectID string `mapstructure:"testProjectID"`
}
func NewTestConfig(componentName string, operations []string, configMap map[string]interface{}) (TestConfig, error) {
// Populate defaults
tc := TestConfig{
CommonConfig: utils.CommonConfig{
ComponentType: "pubsub",
ComponentName: componentName,
Operations: utils.NewStringSet(operations...),
},
PubsubName: defaultPubsubName,
TestTopicName: defaultTopicName,
TestMultiTopic1Name: defaultMultiTopic1Name,
TestMultiTopic2Name: defaultMultiTopic2Name,
MessageCount: defaultMessageCount,
MaxReadDuration: defaultMaxReadDuration,
WaitDurationToPublish: defaultWaitDurationToPublish,
PublishMetadata: map[string]string{},
SubscribeMetadata: map[string]string{},
BulkSubscribeMetadata: map[string]string{},
CheckInOrderProcessing: defaultCheckInOrderProcessing,
TestTopicForBulkSub: defaultTopicNameBulk,
TestProjectID: defaultProjectID,
}
err := config.Decode(configMap, &tc)
return tc, err
}
func ConformanceTests(t *testing.T, props map[string]string, ps pubsub.PubSub, config TestConfig) {
// Properly close pubsub
defer ps.Close()
actualReadCount := 0
// Init
t.Run("init", func(t *testing.T) {
err := ps.Init(context.Background(), pubsub.Metadata{Base: metadata.Base{
Properties: props,
}})
require.NoError(t, err, "expected no error on setting up pubsub")
})
t.Run("ping", func(t *testing.T) {
err := pubsub.Ping(context.Background(), ps)
// TODO: Ideally, all stable components should implenment ping function,
// so will only assert require.NoError(t, err) finally, i.e. when current implementation
// implements ping in existing stable components
if err != nil {
require.EqualError(t, err, "ping is not implemented by this pubsub")
} else {
require.NoError(t, err)
}
})
// Generate a unique ID for this run to isolate messages to this test
// and prevent messages still stored in a locally running broker
// from being considered as part of this test.
runID := uuid.Must(uuid.NewRandom()).String()
awaitingMessages := make(map[string]struct{}, 20)
var mu sync.Mutex
processedMessages := make(map[int]struct{}, 20)
processedC := make(chan string, config.MessageCount*2)
errorCount := 0
dataPrefix := "message-" + runID + "-"
var outOfOrder bool
ctx := context.Background()
awaitingMessagesBulk := make(map[string]struct{}, 20)
processedMessagesBulk := make(map[int]struct{}, 20)
processedCBulk := make(chan string, config.MessageCount*2)
errorCountBulk := 0
var muBulk sync.Mutex
// Subscribe
t.Run("subscribe", func(t *testing.T) {
var counter int
var lastSequence int
err := ps.Subscribe(ctx, pubsub.SubscribeRequest{
Topic: config.TestTopicName,
Metadata: config.SubscribeMetadata,
}, func(ctx context.Context, msg *pubsub.NewMessage) error {
dataString := string(msg.Data)
if !strings.HasPrefix(dataString, dataPrefix) {
t.Logf("Ignoring message without expected prefix")
return nil
}
sequence, err := strconv.Atoi(dataString[len(dataPrefix):])
if err != nil {
t.Logf("Message did not contain a sequence number")
assert.Fail(t, "message did not contain a sequence number")
return err
}
// Ignore already processed messages
// in case we receive a redelivery from the broker
// during retries.
mu.Lock()
_, alreadyProcessed := processedMessages[sequence]
mu.Unlock()
if alreadyProcessed {
t.Logf("Message was already processed: %d", sequence)
return nil
}
counter++
// Only consider order when we receive a message for the first time
// Messages that fail and are re-queued will naturally come out of order
if errorCount == 0 {
if sequence < lastSequence {
outOfOrder = true
t.Logf("Message received out of order: expected sequence >= %d, got %d", lastSequence, sequence)
}
lastSequence = sequence
}
// This behavior is standard to repro a failure of one message in a batch.
if errorCount < 2 || counter%5 == 0 {
// First message errors just to give time for more messages to pile up.
// Second error is to force an error in a batch.
errorCount++
// Sleep to allow messages to pile up and be delivered as a batch.
time.Sleep(1 * time.Second)
t.Logf("Simulating subscriber error")
return errors.New("conf test simulated error")
}
t.Logf("Simulating subscriber success")
actualReadCount++
mu.Lock()
processedMessages[sequence] = struct{}{}
mu.Unlock()
processedC <- dataString
return nil
})
require.NoError(t, err, "expected no error on subscribe")
})
// Bulk Subscribe
if config.HasOperation("bulksubscribe") { //nolint:nestif
t.Run("bulkSubscribe", func(t *testing.T) {
bS, ok := ps.(pubsub.BulkSubscriber)
if !ok {
t.Fatalf("cannot run bulkSubscribe conformance, BulkSubscriber interface not implemented by the component %s", config.ComponentName)
}
var counter int
var lastSequence int
err := bS.BulkSubscribe(ctx, pubsub.SubscribeRequest{
Topic: config.TestTopicForBulkSub,
Metadata: config.BulkSubscribeMetadata,
BulkSubscribeConfig: pubsub.BulkSubscribeConfig{
MaxMessagesCount: defaultMaxBulkCount,
MaxAwaitDurationMs: defaultMaxBulkAwaitDurationMs,
},
}, func(ctx context.Context, bulkMsg *pubsub.BulkMessage) ([]pubsub.BulkSubscribeResponseEntry, error) {
bulkResponses := make([]pubsub.BulkSubscribeResponseEntry, len(bulkMsg.Entries))
hasAnyError := false
for i, msg := range bulkMsg.Entries {
dataString := string(msg.Event)
if !strings.HasPrefix(dataString, dataPrefix) {
t.Logf("Ignoring message without expected prefix")
bulkResponses[i].EntryId = msg.EntryId
bulkResponses[i].Error = nil
continue
}
sequence, err := strconv.Atoi(dataString[len(dataPrefix):])
if err != nil {
t.Logf("Message did not contain a sequence number")
assert.Fail(t, "message did not contain a sequence number")
bulkResponses[i].EntryId = msg.EntryId
bulkResponses[i].Error = err
hasAnyError = true
continue
}
// Ignore already processed messages
// in case we receive a redelivery from the broker
// during retries.
muBulk.Lock()
_, alreadyProcessed := processedMessagesBulk[sequence]
muBulk.Unlock()
if alreadyProcessed {
t.Logf("Message was already processed: %d", sequence)
bulkResponses[i].EntryId = msg.EntryId
bulkResponses[i].Error = nil
continue
}
counter++
// Only consider order when we receive a message for the first time
// Messages that fail and are re-queued will naturally come out of order
if errorCountBulk == 0 {
if sequence < lastSequence {
outOfOrder = true
t.Logf("Message received out of order: expected sequence >= %d, got %d", lastSequence, sequence)
}
lastSequence = sequence
}
// This behavior is standard to repro a failure of one message in a batch.
if errorCountBulk < 2 || counter%5 == 0 {
// First message errors just to give time for more messages to pile up.
// Second error is to force an error in a batch.
errorCountBulk++
// Sleep to allow messages to pile up and be delivered as a batch.
time.Sleep(1 * time.Second)
t.Logf("Simulating subscriber error")
bulkResponses[i].EntryId = msg.EntryId
bulkResponses[i].Error = errors.New("conf test simulated error")
hasAnyError = true
continue
}
t.Logf("Simulating subscriber success")
actualReadCount++
muBulk.Lock()
processedMessagesBulk[sequence] = struct{}{}
muBulk.Unlock()
processedCBulk <- dataString
bulkResponses[i].EntryId = msg.EntryId
bulkResponses[i].Error = nil
}
if hasAnyError {
return bulkResponses, errors.New("at least one message errorred out")
}
return bulkResponses, nil
})
require.NoError(t, err, "expected no error on bulk subscribe")
})
}
// Publish
t.Run("publish", func(t *testing.T) {
// Some pubsub, like Kafka need to wait for Subscriber to be up before messages can be consumed.
// So, wait for some time here.
time.Sleep(config.WaitDurationToPublish)
for k := 1; k <= config.MessageCount; k++ {
data := []byte(fmt.Sprintf("%s%d", dataPrefix, k))
err := ps.Publish(ctx, &pubsub.PublishRequest{
Data: data,
PubsubName: config.PubsubName,
Topic: config.TestTopicName,
Metadata: config.PublishMetadata,
})
if err == nil {
awaitingMessages[string(data)] = struct{}{}
}
require.NoError(t, err, "expected no error on publishing data %s on topic %s", data, config.TestTopicName)
}
if config.HasOperation("bulksubscribe") {
_, ok := ps.(pubsub.BulkSubscriber)
if !ok {
t.Fatalf("cannot run bulkSubscribe conformance, BulkSubscriber interface not implemented by the component %s", config.ComponentName)
}
for k := bulkSubStartingKey; k <= (bulkSubStartingKey + config.MessageCount); k++ {
data := []byte(fmt.Sprintf("%s%d", dataPrefix, k))
err := ps.Publish(ctx, &pubsub.PublishRequest{
Data: data,
PubsubName: config.PubsubName,
Topic: config.TestTopicForBulkSub,
Metadata: config.PublishMetadata,
})
if err == nil {
awaitingMessagesBulk[string(data)] = struct{}{}
}
require.NoError(t, err, "expected no error on publishing data %s on topic %s", data, config.TestTopicForBulkSub)
}
}
})
// assumes that publish operation is run only once for publishing config.MessageCount number of events
// bulkpublish needs to be run after publish operation
if config.HasOperation("bulkpublish") {
t.Run("bulkPublish", func(t *testing.T) {
bP, ok := ps.(pubsub.BulkPublisher)
if !ok {
t.Fatalf("cannot run bulkPublish conformance, BulkPublisher interface not implemented by the component %s", config.ComponentName)
}
// only run the test if BulkPublish is implemented
// Some pubsub, like Kafka need to wait for Subscriber to be up before messages can be consumed.
// So, wait for some time here.
time.Sleep(config.WaitDurationToPublish)
req := pubsub.BulkPublishRequest{
PubsubName: config.PubsubName,
Topic: config.TestTopicName,
Metadata: config.PublishMetadata,
Entries: make([]pubsub.BulkMessageEntry, config.MessageCount),
}
entryMap := map[string][]byte{}
// setting k to one value more than the previously published list of events.
// assuming that publish test is run only once and bulkPublish is run right after that
for i, k := 0, config.MessageCount+1; i < config.MessageCount; {
data := []byte(fmt.Sprintf("%s%d", dataPrefix, k))
strK := strconv.Itoa(k)
req.Entries[i].EntryId = strK
req.Entries[i].ContentType = "text/plain"
req.Entries[i].Metadata = config.PublishMetadata
req.Entries[i].Event = data
entryMap[strK] = data
t.Logf("Adding message with ID %d for bulk publish", k)
k++
i++
}
t.Logf("Calling Bulk Publish on component %s", config.ComponentName)
// Making use of entryMap defined above here to iterate through entryIds of messages published.
res, err := bP.BulkPublish(context.Background(), &req)
faileEntries := convertBulkPublishResponseToStringSlice(res)
if err == nil {
for k := range entryMap {
if !slices.Contains(faileEntries, k) {
data := entryMap[k]
t.Logf("adding to awaited messages %s", data)
awaitingMessages[string(data)] = struct{}{}
}
}
}
// here only the success case is tested for bulkPublish similar to publish.
// For scenarios on partial failures, those will be tested as part of certification tests if possible.
require.NoError(t, err, "expected no error on bulk publishing on topic %s", config.TestTopicName)
})
}
// Verify read
t.Run("verify read", func(t *testing.T) {
t.Logf("waiting for %v to complete read", config.MaxReadDuration)
timeout := time.After(config.MaxReadDuration)
waiting := true
for waiting {
select {
case processed := <-processedC:
t.Logf("deleting %s processed message", processed)
delete(awaitingMessages, processed)
waiting = len(awaitingMessages) > 0
case <-timeout:
// Break out after the mamimum read duration has elapsed
waiting = false
}
}
assert.False(t, config.CheckInOrderProcessing && outOfOrder, "received messages out of order")
assert.Empty(t, awaitingMessages, "expected to read %v messages", config.MessageCount)
})
// Verify read on bulk subscription
if config.HasOperation("bulksubscribe") {
t.Run("verify read on bulk subscription", func(t *testing.T) {
_, ok := ps.(pubsub.BulkSubscriber)
if !ok {
t.Fatalf("cannot run bulkSubscribe conformance, BulkSubscriber interface not implemented by the component %s", config.ComponentName)
}
t.Logf("waiting for %v to complete read for bulk subscription", config.MaxReadDuration)
timeout := time.After(config.MaxReadDuration)
waiting := true
for waiting {
select {
case processed := <-processedCBulk:
delete(awaitingMessagesBulk, processed)
waiting = len(awaitingMessagesBulk) > 0
case <-timeout:
// Break out after the mamimum read duration has elapsed
waiting = false
}
}
assert.False(t, config.CheckInOrderProcessing && outOfOrder, "received messages out of order")
assert.Empty(t, awaitingMessagesBulk, "expected to read %v messages", config.MessageCount)
})
}
// Multiple handlers
t.Run("multiple handlers", func(t *testing.T) {
received1Ch := make(chan string)
received2Ch := make(chan string)
subscribe1Ctx, subscribe1Cancel := context.WithCancel(context.Background())
subscribe2Ctx, subscribe2Cancel := context.WithCancel(context.Background())
defer func() {
subscribe1Cancel()
subscribe2Cancel()
close(received1Ch)
close(received2Ch)
}()
t.Run("mutiple handlers", func(t *testing.T) {
createMultiSubscriber(t, subscribe1Ctx, received1Ch, ps, config.TestMultiTopic1Name, config.SubscribeMetadata, dataPrefix)
createMultiSubscriber(t, subscribe2Ctx, received2Ch, ps, config.TestMultiTopic2Name, config.SubscribeMetadata, dataPrefix)
sent1Ch := make(chan string)
sent2Ch := make(chan string)
allSentCh := make(chan bool)
defer func() {
close(sent1Ch)
close(sent2Ch)
close(allSentCh)
}()
wait := receiveInBackground(t, config.MaxReadDuration, received1Ch, received2Ch, sent1Ch, sent2Ch, allSentCh)
for k := (config.MessageCount + 1); k <= (config.MessageCount * 2); k++ {
data := []byte(fmt.Sprintf("%s%d", dataPrefix, k))
var topic string
if k%2 == 0 {
topic = config.TestMultiTopic1Name
sent1Ch <- string(data)
} else {
topic = config.TestMultiTopic2Name
sent2Ch <- string(data)
}
err := ps.Publish(ctx, &pubsub.PublishRequest{
Data: data,
PubsubName: config.PubsubName,
Topic: topic,
Metadata: config.PublishMetadata,
})
require.NoError(t, err, "expected no error on publishing data %s on topic %s", data, topic)
}
allSentCh <- true
t.Logf("waiting for %v to complete read", config.MaxReadDuration)
<-wait
})
t.Run("stop subscribers", func(t *testing.T) {
sent1Ch := make(chan string)
sent2Ch := make(chan string)
allSentCh := make(chan bool)
defer func() {
close(allSentCh)
}()
for i := 0; i < 3; i++ {
t.Logf("Starting iteration %d", i)
switch i {
case 1: // On iteration 1, close the first subscriber
subscribe1Cancel()
close(sent1Ch)
sent1Ch = nil
time.Sleep(config.WaitDurationToPublish)
case 2: // On iteration 2, close the second subscriber
subscribe2Cancel()
close(sent2Ch)
sent2Ch = nil
time.Sleep(config.WaitDurationToPublish)
}
wait := receiveInBackground(t, config.MaxReadDuration, received1Ch, received2Ch, sent1Ch, sent2Ch, allSentCh)
offset := config.MessageCount * (i + 2)
for k := offset + 1; k <= (offset + config.MessageCount); k++ {
data := []byte(fmt.Sprintf("%s%d", dataPrefix, k))
var topic string
if k%2 == 0 {
topic = config.TestMultiTopic1Name
if sent1Ch != nil {
sent1Ch <- string(data)
}
} else {
topic = config.TestMultiTopic2Name
if sent2Ch != nil {
sent2Ch <- string(data)
}
}
err := ps.Publish(ctx, &pubsub.PublishRequest{
Data: data,
PubsubName: config.PubsubName,
Topic: topic,
Metadata: config.PublishMetadata,
})
require.NoError(t, err, "expected no error on publishing data %s on topic %s", string(data), topic)
}
allSentCh <- true
t.Logf("Waiting for %v to complete read", config.MaxReadDuration)
<-wait
}
})
})
}
func receiveInBackground(t *testing.T, timeout time.Duration, received1Ch <-chan string, received2Ch <-chan string, sent1Ch <-chan string, sent2Ch <-chan string, allSentCh <-chan bool) <-chan struct{} {
done := make(chan struct{})
go func() {
receivedTopic1 := make([]string, 0)
expectedTopic1 := make([]string, 0)
receivedTopic2 := make([]string, 0)
expectedTopic2 := make([]string, 0)
to := time.NewTimer(timeout)
allSent := false
defer func() {
to.Stop()
close(done)
}()
for {
select {
case msg := <-received1Ch:
receivedTopic1 = append(receivedTopic1, msg)
case msg := <-received2Ch:
receivedTopic2 = append(receivedTopic2, msg)
case msg := <-sent1Ch:
expectedTopic1 = append(expectedTopic1, msg)
case msg := <-sent2Ch:
expectedTopic2 = append(expectedTopic2, msg)
case v := <-allSentCh:
allSent = v
case <-to.C:
assert.Failf(t, "timeout while waiting for messages in multihandlers", "receivedTopic1=%v expectedTopic1=%v receivedTopic2=%v expectedTopic2=%v", receivedTopic1, expectedTopic1, receivedTopic2, expectedTopic2)
return
}
if allSent && compareReceivedAndExpected(receivedTopic1, expectedTopic1) && compareReceivedAndExpected(receivedTopic2, expectedTopic2) {
return
}
}
}()
return done
}
func compareReceivedAndExpected(received []string, expected []string) bool {
sort.Strings(received)
sort.Strings(expected)
return reflect.DeepEqual(received, expected)
}
func createMultiSubscriber(t *testing.T, subscribeCtx context.Context, ch chan<- string, ps pubsub.PubSub, topic string, subscribeMetadata map[string]string, dataPrefix string) {
err := ps.Subscribe(subscribeCtx, pubsub.SubscribeRequest{
Topic: topic,
Metadata: subscribeMetadata,
}, func(ctx context.Context, msg *pubsub.NewMessage) error {
dataString := string(msg.Data)
if !strings.HasPrefix(dataString, dataPrefix) {
t.Log("Ignoring message without expected prefix", dataString)
return nil
}
ch <- string(msg.Data)
return nil
})
require.NoError(t, err, "expected no error on subscribe")
}
func convertBulkPublishResponseToStringSlice(res pubsub.BulkPublishResponse) []string {
failedEntries := make([]string, 0, len(res.FailedEntries))
for _, failedEntry := range res.FailedEntries {
failedEntries = append(failedEntries, failedEntry.EntryId)
}
return failedEntries
}