• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber / cadence / 01880c2e-e2ba-4ec5-8826-bcc19bd1c271

11 May 2023 07:21PM UTC coverage: 57.263% (-0.07%) from 57.331%
01880c2e-e2ba-4ec5-8826-bcc19bd1c271

push

buildkite

GitHub
Adds tooling (#5283)

369 of 369 new or added lines in 9 files covered. (100.0%)

86922 of 151794 relevant lines covered (57.26%)

2472.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/client/admin/errorInjectionClient.go
1
// Copyright (c) 2017-2020 Uber Technologies, Inc.
2
//
3
// Permission is hereby granted, free of charge, to any person obtaining a copy
4
// of this software and associated documentation files (the "Software"), to deal
5
// in the Software without restriction, including without limitation the rights
6
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
// copies of the Software, and to permit persons to whom the Software is
8
// furnished to do so, subject to the following conditions:
9
//
10
// The above copyright notice and this permission notice shall be included in
11
// all copies or substantial portions of the Software.
12
//
13
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
// THE SOFTWARE.
20

21
package admin
22

23
import (
24
        "context"
25

26
        "go.uber.org/yarpc"
27

28
        "github.com/uber/cadence/common/errors"
29
        "github.com/uber/cadence/common/log"
30
        "github.com/uber/cadence/common/log/tag"
31
        "github.com/uber/cadence/common/types"
32
)
33

34
var _ Client = (*errorInjectionClient)(nil)
35

36
const (
37
        msgInjectedFakeErr = "Injected fake admin client error"
38
)
39

40
type errorInjectionClient struct {
41
        client    Client
42
        errorRate float64
43
        logger    log.Logger
44
}
45

46
// NewErrorInjectionClient creates a new instance of Client that injects fake error
47
func NewErrorInjectionClient(
48
        client Client,
49
        errorRate float64,
50
        logger log.Logger,
51
) Client {
×
52
        return &errorInjectionClient{
×
53
                client:    client,
×
54
                errorRate: errorRate,
×
55
                logger:    logger,
×
56
        }
×
57
}
×
58

59
func (c *errorInjectionClient) AddSearchAttribute(
60
        ctx context.Context,
61
        request *types.AddSearchAttributeRequest,
62
        opts ...yarpc.CallOption,
63
) error {
×
64
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
65

×
66
        var clientErr error
×
67
        var forwardCall bool
×
68
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
69
                clientErr = c.client.AddSearchAttribute(ctx, request, opts...)
×
70
        }
×
71

72
        if fakeErr != nil {
×
73
                c.logger.Error(msgInjectedFakeErr,
×
74
                        tag.AdminClientOperationAddSearchAttribute,
×
75
                        tag.Error(fakeErr),
×
76
                        tag.Bool(forwardCall),
×
77
                        tag.ClientError(clientErr),
×
78
                )
×
79
                return fakeErr
×
80
        }
×
81
        return clientErr
×
82
}
83

84
func (c *errorInjectionClient) DescribeShardDistribution(
85
        ctx context.Context,
86
        request *types.DescribeShardDistributionRequest,
87
        opts ...yarpc.CallOption,
88
) (*types.DescribeShardDistributionResponse, error) {
×
89
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
90

×
91
        var resp *types.DescribeShardDistributionResponse
×
92
        var clientErr error
×
93
        var forwardCall bool
×
94
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
95
                resp, clientErr = c.client.DescribeShardDistribution(ctx, request, opts...)
×
96
        }
×
97

98
        if fakeErr != nil {
×
99
                c.logger.Error(msgInjectedFakeErr,
×
100
                        tag.AdminClientOperationDescribeShardDistribution,
×
101
                        tag.Error(fakeErr),
×
102
                        tag.Bool(forwardCall),
×
103
                        tag.ClientError(clientErr),
×
104
                )
×
105
                return nil, fakeErr
×
106
        }
×
107
        return resp, clientErr
×
108
}
109

110
func (c *errorInjectionClient) DescribeHistoryHost(
111
        ctx context.Context,
112
        request *types.DescribeHistoryHostRequest,
113
        opts ...yarpc.CallOption,
114
) (*types.DescribeHistoryHostResponse, error) {
×
115
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
116

×
117
        var resp *types.DescribeHistoryHostResponse
×
118
        var clientErr error
×
119
        var forwardCall bool
×
120
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
121
                resp, clientErr = c.client.DescribeHistoryHost(ctx, request, opts...)
×
122
        }
×
123

124
        if fakeErr != nil {
×
125
                c.logger.Error(msgInjectedFakeErr,
×
126
                        tag.AdminClientOperationDescribeHistoryHost,
×
127
                        tag.Error(fakeErr),
×
128
                        tag.Bool(forwardCall),
×
129
                        tag.ClientError(clientErr),
×
130
                )
×
131
                return nil, fakeErr
×
132
        }
×
133
        return resp, clientErr
×
134
}
135

136
func (c *errorInjectionClient) RemoveTask(
137
        ctx context.Context,
138
        request *types.RemoveTaskRequest,
139
        opts ...yarpc.CallOption,
140
) error {
×
141
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
142

×
143
        var clientErr error
×
144
        var forwardCall bool
×
145
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
146
                clientErr = c.client.RemoveTask(ctx, request, opts...)
×
147
        }
×
148

149
        if fakeErr != nil {
×
150
                c.logger.Error(msgInjectedFakeErr,
×
151
                        tag.AdminClientOperationRemoveTask,
×
152
                        tag.Error(fakeErr),
×
153
                        tag.Bool(forwardCall),
×
154
                        tag.ClientError(clientErr),
×
155
                )
×
156
                return fakeErr
×
157
        }
×
158
        return clientErr
×
159
}
160

161
func (c *errorInjectionClient) CloseShard(
162
        ctx context.Context,
163
        request *types.CloseShardRequest,
164
        opts ...yarpc.CallOption,
165
) error {
×
166
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
167

×
168
        var clientErr error
×
169
        var forwardCall bool
×
170
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
171
                clientErr = c.client.CloseShard(ctx, request, opts...)
×
172
        }
×
173

174
        if fakeErr != nil {
×
175
                c.logger.Error(msgInjectedFakeErr,
×
176
                        tag.AdminClientOperationCloseShard,
×
177
                        tag.Error(fakeErr),
×
178
                        tag.Bool(forwardCall),
×
179
                        tag.ClientError(clientErr),
×
180
                )
×
181
                return fakeErr
×
182
        }
×
183
        return clientErr
×
184
}
185

186
func (c *errorInjectionClient) ResetQueue(
187
        ctx context.Context,
188
        request *types.ResetQueueRequest,
189
        opts ...yarpc.CallOption,
190
) error {
×
191
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
192

×
193
        var clientErr error
×
194
        var forwardCall bool
×
195
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
196
                clientErr = c.client.ResetQueue(ctx, request, opts...)
×
197
        }
×
198

199
        if fakeErr != nil {
×
200
                c.logger.Error(msgInjectedFakeErr,
×
201
                        tag.AdminClientOperationResetQueue,
×
202
                        tag.Error(fakeErr),
×
203
                        tag.Bool(forwardCall),
×
204
                        tag.ClientError(clientErr),
×
205
                )
×
206
                return fakeErr
×
207
        }
×
208
        return clientErr
×
209
}
210

211
func (c *errorInjectionClient) DescribeQueue(
212
        ctx context.Context,
213
        request *types.DescribeQueueRequest,
214
        opts ...yarpc.CallOption,
215
) (*types.DescribeQueueResponse, error) {
×
216
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
217

×
218
        var resp *types.DescribeQueueResponse
×
219
        var clientErr error
×
220
        var forwardCall bool
×
221
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
222
                resp, clientErr = c.client.DescribeQueue(ctx, request, opts...)
×
223
        }
×
224

225
        if fakeErr != nil {
×
226
                c.logger.Error(msgInjectedFakeErr,
×
227
                        tag.AdminClientOperationDescribeQueue,
×
228
                        tag.Error(fakeErr),
×
229
                        tag.Bool(forwardCall),
×
230
                        tag.ClientError(clientErr),
×
231
                )
×
232
                return nil, fakeErr
×
233
        }
×
234
        return resp, clientErr
×
235
}
236

237
func (c *errorInjectionClient) DescribeWorkflowExecution(
238
        ctx context.Context,
239
        request *types.AdminDescribeWorkflowExecutionRequest,
240
        opts ...yarpc.CallOption,
241
) (*types.AdminDescribeWorkflowExecutionResponse, error) {
×
242
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
243

×
244
        var resp *types.AdminDescribeWorkflowExecutionResponse
×
245
        var clientErr error
×
246
        var forwardCall bool
×
247
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
248
                resp, clientErr = c.client.DescribeWorkflowExecution(ctx, request, opts...)
×
249
        }
×
250

251
        if fakeErr != nil {
×
252
                c.logger.Error(msgInjectedFakeErr,
×
253
                        tag.AdminClientOperationDescribeWorkflowExecution,
×
254
                        tag.Error(fakeErr),
×
255
                        tag.Bool(forwardCall),
×
256
                        tag.ClientError(clientErr),
×
257
                )
×
258
                return nil, fakeErr
×
259
        }
×
260
        return resp, clientErr
×
261
}
262

263
func (c *errorInjectionClient) GetWorkflowExecutionRawHistoryV2(
264
        ctx context.Context,
265
        request *types.GetWorkflowExecutionRawHistoryV2Request,
266
        opts ...yarpc.CallOption,
267
) (*types.GetWorkflowExecutionRawHistoryV2Response, error) {
×
268
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
269

×
270
        var resp *types.GetWorkflowExecutionRawHistoryV2Response
×
271
        var clientErr error
×
272
        var forwardCall bool
×
273
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
274
                resp, clientErr = c.client.GetWorkflowExecutionRawHistoryV2(ctx, request, opts...)
×
275
        }
×
276

277
        if fakeErr != nil {
×
278
                c.logger.Error(msgInjectedFakeErr,
×
279
                        tag.AdminClientOperationGetWorkflowExecutionRawHistoryV2,
×
280
                        tag.Error(fakeErr),
×
281
                        tag.Bool(forwardCall),
×
282
                        tag.ClientError(clientErr),
×
283
                )
×
284
                return nil, fakeErr
×
285
        }
×
286
        return resp, clientErr
×
287
}
288

289
func (c *errorInjectionClient) DescribeCluster(
290
        ctx context.Context,
291
        opts ...yarpc.CallOption,
292
) (*types.DescribeClusterResponse, error) {
×
293
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
294

×
295
        var resp *types.DescribeClusterResponse
×
296
        var clientErr error
×
297
        var forwardCall bool
×
298
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
299
                resp, clientErr = c.client.DescribeCluster(ctx, opts...)
×
300
        }
×
301

302
        if fakeErr != nil {
×
303
                c.logger.Error(msgInjectedFakeErr,
×
304
                        tag.AdminClientOperationDescribeCluster,
×
305
                        tag.Error(fakeErr),
×
306
                        tag.Bool(forwardCall),
×
307
                        tag.ClientError(clientErr),
×
308
                )
×
309
                return nil, fakeErr
×
310
        }
×
311
        return resp, clientErr
×
312
}
313

314
func (c *errorInjectionClient) GetReplicationMessages(
315
        ctx context.Context,
316
        request *types.GetReplicationMessagesRequest,
317
        opts ...yarpc.CallOption,
318
) (*types.GetReplicationMessagesResponse, error) {
×
319
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
320

×
321
        var resp *types.GetReplicationMessagesResponse
×
322
        var clientErr error
×
323
        var forwardCall bool
×
324
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
325
                resp, clientErr = c.client.GetReplicationMessages(ctx, request, opts...)
×
326
        }
×
327

328
        if fakeErr != nil {
×
329
                c.logger.Error(msgInjectedFakeErr,
×
330
                        tag.AdminClientOperationGetReplicationMessages,
×
331
                        tag.Error(fakeErr),
×
332
                        tag.Bool(forwardCall),
×
333
                        tag.ClientError(clientErr),
×
334
                )
×
335
                return nil, fakeErr
×
336
        }
×
337
        return resp, clientErr
×
338
}
339

340
func (c *errorInjectionClient) GetDomainReplicationMessages(
341
        ctx context.Context,
342
        request *types.GetDomainReplicationMessagesRequest,
343
        opts ...yarpc.CallOption,
344
) (*types.GetDomainReplicationMessagesResponse, error) {
×
345
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
346

×
347
        var resp *types.GetDomainReplicationMessagesResponse
×
348
        var clientErr error
×
349
        var forwardCall bool
×
350
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
351
                resp, clientErr = c.client.GetDomainReplicationMessages(ctx, request, opts...)
×
352
        }
×
353

354
        if fakeErr != nil {
×
355
                c.logger.Error(msgInjectedFakeErr,
×
356
                        tag.AdminClientOperationGetDomainReplicationMessages,
×
357
                        tag.Error(fakeErr),
×
358
                        tag.Bool(forwardCall),
×
359
                        tag.ClientError(clientErr),
×
360
                )
×
361
                return nil, fakeErr
×
362
        }
×
363
        return resp, clientErr
×
364
}
365

366
func (c *errorInjectionClient) GetDLQReplicationMessages(
367
        ctx context.Context,
368
        request *types.GetDLQReplicationMessagesRequest,
369
        opts ...yarpc.CallOption,
370
) (*types.GetDLQReplicationMessagesResponse, error) {
×
371
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
372

×
373
        var resp *types.GetDLQReplicationMessagesResponse
×
374
        var clientErr error
×
375
        var forwardCall bool
×
376
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
377
                resp, clientErr = c.client.GetDLQReplicationMessages(ctx, request, opts...)
×
378
        }
×
379

380
        if fakeErr != nil {
×
381
                c.logger.Error(msgInjectedFakeErr,
×
382
                        tag.AdminClientOperationGetDLQReplicationMessages,
×
383
                        tag.Error(fakeErr),
×
384
                        tag.Bool(forwardCall),
×
385
                        tag.ClientError(clientErr),
×
386
                )
×
387
                return nil, fakeErr
×
388
        }
×
389
        return resp, clientErr
×
390
}
391

392
func (c *errorInjectionClient) ReapplyEvents(
393
        ctx context.Context,
394
        request *types.ReapplyEventsRequest,
395
        opts ...yarpc.CallOption,
396
) error {
×
397
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
398

×
399
        var clientErr error
×
400
        var forwardCall bool
×
401
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
402
                clientErr = c.client.ReapplyEvents(ctx, request, opts...)
×
403
        }
×
404

405
        if fakeErr != nil {
×
406
                c.logger.Error(msgInjectedFakeErr,
×
407
                        tag.AdminClientOperationReapplyEvents,
×
408
                        tag.Error(fakeErr),
×
409
                        tag.Bool(forwardCall),
×
410
                        tag.ClientError(clientErr),
×
411
                )
×
412
                return fakeErr
×
413
        }
×
414
        return clientErr
×
415
}
416

417
func (c *errorInjectionClient) CountDLQMessages(
418
        ctx context.Context,
419
        request *types.CountDLQMessagesRequest,
420
        opts ...yarpc.CallOption,
421
) (*types.CountDLQMessagesResponse, error) {
×
422
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
423

×
424
        var resp *types.CountDLQMessagesResponse
×
425
        var clientErr error
×
426
        var forwardCall bool
×
427
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
428
                resp, clientErr = c.client.CountDLQMessages(ctx, request, opts...)
×
429
        }
×
430

431
        if fakeErr != nil {
×
432
                c.logger.Error(msgInjectedFakeErr,
×
433
                        tag.AdminClientOperationCountDLQMessages,
×
434
                        tag.Error(fakeErr),
×
435
                        tag.Bool(forwardCall),
×
436
                        tag.ClientError(clientErr),
×
437
                )
×
438
                return nil, fakeErr
×
439
        }
×
440
        return resp, clientErr
×
441
}
442

443
func (c *errorInjectionClient) ReadDLQMessages(
444
        ctx context.Context,
445
        request *types.ReadDLQMessagesRequest,
446
        opts ...yarpc.CallOption,
447
) (*types.ReadDLQMessagesResponse, error) {
×
448
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
449

×
450
        var resp *types.ReadDLQMessagesResponse
×
451
        var clientErr error
×
452
        var forwardCall bool
×
453
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
454
                resp, clientErr = c.client.ReadDLQMessages(ctx, request, opts...)
×
455
        }
×
456

457
        if fakeErr != nil {
×
458
                c.logger.Error(msgInjectedFakeErr,
×
459
                        tag.AdminClientOperationReadDLQMessages,
×
460
                        tag.Error(fakeErr),
×
461
                        tag.Bool(forwardCall),
×
462
                        tag.ClientError(clientErr),
×
463
                )
×
464
                return nil, fakeErr
×
465
        }
×
466
        return resp, clientErr
×
467
}
468

469
func (c *errorInjectionClient) PurgeDLQMessages(
470
        ctx context.Context,
471
        request *types.PurgeDLQMessagesRequest,
472
        opts ...yarpc.CallOption,
473
) error {
×
474
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
475

×
476
        var clientErr error
×
477
        var forwardCall bool
×
478
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
479
                clientErr = c.client.PurgeDLQMessages(ctx, request, opts...)
×
480
        }
×
481

482
        if fakeErr != nil {
×
483
                c.logger.Error(msgInjectedFakeErr,
×
484
                        tag.AdminClientOperationPurgeDLQMessages,
×
485
                        tag.Error(fakeErr),
×
486
                        tag.Bool(forwardCall),
×
487
                        tag.ClientError(clientErr),
×
488
                )
×
489
                return fakeErr
×
490
        }
×
491
        return clientErr
×
492
}
493

494
func (c *errorInjectionClient) MergeDLQMessages(
495
        ctx context.Context,
496
        request *types.MergeDLQMessagesRequest,
497
        opts ...yarpc.CallOption,
498
) (*types.MergeDLQMessagesResponse, error) {
×
499
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
500

×
501
        var resp *types.MergeDLQMessagesResponse
×
502
        var clientErr error
×
503
        var forwardCall bool
×
504
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
505
                resp, clientErr = c.client.MergeDLQMessages(ctx, request, opts...)
×
506
        }
×
507

508
        if fakeErr != nil {
×
509
                c.logger.Error(msgInjectedFakeErr,
×
510
                        tag.AdminClientOperationMergeDLQMessages,
×
511
                        tag.Error(fakeErr),
×
512
                        tag.Bool(forwardCall),
×
513
                        tag.ClientError(clientErr),
×
514
                )
×
515
                return nil, fakeErr
×
516
        }
×
517
        return resp, clientErr
×
518
}
519

520
func (c *errorInjectionClient) RefreshWorkflowTasks(
521
        ctx context.Context,
522
        request *types.RefreshWorkflowTasksRequest,
523
        opts ...yarpc.CallOption,
524
) error {
×
525
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
526

×
527
        var clientErr error
×
528
        var forwardCall bool
×
529
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
530
                clientErr = c.client.RefreshWorkflowTasks(ctx, request, opts...)
×
531
        }
×
532

533
        if fakeErr != nil {
×
534
                c.logger.Error(msgInjectedFakeErr,
×
535
                        tag.AdminClientOperationRefreshWorkflowTasks,
×
536
                        tag.Error(fakeErr),
×
537
                        tag.Bool(forwardCall),
×
538
                        tag.ClientError(clientErr),
×
539
                )
×
540
                return fakeErr
×
541
        }
×
542
        return clientErr
×
543
}
544

545
func (c *errorInjectionClient) ResendReplicationTasks(
546
        ctx context.Context,
547
        request *types.ResendReplicationTasksRequest,
548
        opts ...yarpc.CallOption,
549
) error {
×
550
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
551

×
552
        var clientErr error
×
553
        var forwardCall bool
×
554
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
555
                clientErr = c.client.ResendReplicationTasks(ctx, request, opts...)
×
556
        }
×
557

558
        if fakeErr != nil {
×
559
                c.logger.Error(msgInjectedFakeErr,
×
560
                        tag.AdminClientOperationResendReplicationTasks,
×
561
                        tag.Error(fakeErr),
×
562
                        tag.Bool(forwardCall),
×
563
                        tag.ClientError(clientErr),
×
564
                )
×
565
                return fakeErr
×
566
        }
×
567
        return clientErr
×
568
}
569

570
func (c *errorInjectionClient) GetCrossClusterTasks(
571
        ctx context.Context,
572
        request *types.GetCrossClusterTasksRequest,
573
        opts ...yarpc.CallOption,
574
) (*types.GetCrossClusterTasksResponse, error) {
×
575
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
576

×
577
        var resp *types.GetCrossClusterTasksResponse
×
578
        var clientErr error
×
579
        var forwardCall bool
×
580
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
581
                resp, clientErr = c.client.GetCrossClusterTasks(ctx, request, opts...)
×
582
        }
×
583

584
        if fakeErr != nil {
×
585
                c.logger.Error(msgInjectedFakeErr,
×
586
                        tag.AdminClientOperationGetCrossClusterTasks,
×
587
                        tag.Error(fakeErr),
×
588
                        tag.Bool(forwardCall),
×
589
                        tag.ClientError(clientErr),
×
590
                )
×
591
                return nil, fakeErr
×
592
        }
×
593
        return resp, clientErr
×
594
}
595

596
func (c *errorInjectionClient) RespondCrossClusterTasksCompleted(
597
        ctx context.Context,
598
        request *types.RespondCrossClusterTasksCompletedRequest,
599
        opts ...yarpc.CallOption,
600
) (*types.RespondCrossClusterTasksCompletedResponse, error) {
×
601
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
602

×
603
        var resp *types.RespondCrossClusterTasksCompletedResponse
×
604
        var clientErr error
×
605
        var forwardCall bool
×
606
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
607
                resp, clientErr = c.client.RespondCrossClusterTasksCompleted(ctx, request, opts...)
×
608
        }
×
609

610
        if fakeErr != nil {
×
611
                c.logger.Error(msgInjectedFakeErr,
×
612
                        tag.AdminClientOperationRespondCrossClusterTasksCompleted,
×
613
                        tag.Error(fakeErr),
×
614
                        tag.Bool(forwardCall),
×
615
                        tag.ClientError(clientErr),
×
616
                )
×
617
                return nil, fakeErr
×
618
        }
×
619
        return resp, clientErr
×
620
}
621

622
func (c *errorInjectionClient) GetDynamicConfig(
623
        ctx context.Context,
624
        request *types.GetDynamicConfigRequest,
625
        opts ...yarpc.CallOption,
626
) (*types.GetDynamicConfigResponse, error) {
×
627
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
628

×
629
        var resp *types.GetDynamicConfigResponse
×
630
        var clientErr error
×
631
        var forwardCall bool
×
632
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
633
                resp, clientErr = c.client.GetDynamicConfig(ctx, request, opts...)
×
634
        }
×
635

636
        if fakeErr != nil {
×
637
                c.logger.Error(msgInjectedFakeErr,
×
638
                        tag.AdminClientOperationGetDynamicConfig,
×
639
                        tag.Error(fakeErr),
×
640
                        tag.Bool(forwardCall),
×
641
                        tag.ClientError(clientErr),
×
642
                )
×
643
                return nil, fakeErr
×
644
        }
×
645
        return resp, clientErr
×
646
}
647

648
func (c *errorInjectionClient) UpdateDynamicConfig(
649
        ctx context.Context,
650
        request *types.UpdateDynamicConfigRequest,
651
        opts ...yarpc.CallOption,
652
) error {
×
653
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
654

×
655
        var clientErr error
×
656
        var forwardCall bool
×
657
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
658
                clientErr = c.client.UpdateDynamicConfig(ctx, request, opts...)
×
659
        }
×
660

661
        if fakeErr != nil {
×
662
                c.logger.Error(msgInjectedFakeErr,
×
663
                        tag.AdminClientOperationUpdateDynamicConfig,
×
664
                        tag.Error(fakeErr),
×
665
                        tag.Bool(forwardCall),
×
666
                        tag.ClientError(clientErr),
×
667
                )
×
668
                return fakeErr
×
669
        }
×
670
        return clientErr
×
671
}
672

673
func (c *errorInjectionClient) RestoreDynamicConfig(
674
        ctx context.Context,
675
        request *types.RestoreDynamicConfigRequest,
676
        opts ...yarpc.CallOption,
677
) error {
×
678
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
679

×
680
        var clientErr error
×
681
        var forwardCall bool
×
682
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
683
                clientErr = c.client.RestoreDynamicConfig(ctx, request, opts...)
×
684
        }
×
685

686
        if fakeErr != nil {
×
687
                c.logger.Error(msgInjectedFakeErr,
×
688
                        tag.AdminClientOperationRestoreDynamicConfig,
×
689
                        tag.Error(fakeErr),
×
690
                        tag.Bool(forwardCall),
×
691
                        tag.ClientError(clientErr),
×
692
                )
×
693
                return fakeErr
×
694
        }
×
695
        return clientErr
×
696
}
697

698
func (c *errorInjectionClient) DeleteWorkflow(
699
        ctx context.Context,
700
        request *types.AdminDeleteWorkflowRequest,
701
        opts ...yarpc.CallOption,
702
) (*types.AdminDeleteWorkflowResponse, error) {
×
703
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
704

×
705
        var resp *types.AdminDeleteWorkflowResponse
×
706
        var clientErr error
×
707
        var forwardCall bool
×
708
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
709
                resp, clientErr = c.client.DeleteWorkflow(ctx, request, opts...)
×
710
        }
×
711

712
        if fakeErr != nil {
×
713
                c.logger.Error(msgInjectedFakeErr,
×
714
                        tag.AdminDeleteWorkflow,
×
715
                        tag.Error(fakeErr),
×
716
                        tag.Bool(forwardCall),
×
717
                        tag.ClientError(clientErr),
×
718
                )
×
719
                return nil, fakeErr
×
720
        }
×
721
        return resp, clientErr
×
722
}
723

724
func (c *errorInjectionClient) MaintainCorruptWorkflow(
725
        ctx context.Context,
726
        request *types.AdminMaintainWorkflowRequest,
727
        opts ...yarpc.CallOption,
728
) (*types.AdminMaintainWorkflowResponse, error) {
×
729
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
730

×
731
        var resp *types.AdminMaintainWorkflowResponse
×
732
        var clientErr error
×
733
        var forwardCall bool
×
734
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
735
                resp, clientErr = c.client.MaintainCorruptWorkflow(ctx, request, opts...)
×
736
        }
×
737

738
        if fakeErr != nil {
×
739
                c.logger.Error(msgInjectedFakeErr,
×
740
                        tag.MaintainCorruptWorkflow,
×
741
                        tag.Error(fakeErr),
×
742
                        tag.Bool(forwardCall),
×
743
                        tag.ClientError(clientErr),
×
744
                )
×
745
                return nil, fakeErr
×
746
        }
×
747
        return resp, clientErr
×
748
}
749

750
func (c *errorInjectionClient) ListDynamicConfig(
751
        ctx context.Context,
752
        request *types.ListDynamicConfigRequest,
753
        opts ...yarpc.CallOption,
754
) (*types.ListDynamicConfigResponse, error) {
×
755
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
756

×
757
        var resp *types.ListDynamicConfigResponse
×
758
        var clientErr error
×
759
        var forwardCall bool
×
760
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
761
                resp, clientErr = c.client.ListDynamicConfig(ctx, request, opts...)
×
762
        }
×
763

764
        if fakeErr != nil {
×
765
                c.logger.Error(msgInjectedFakeErr,
×
766
                        tag.AdminClientOperationListDynamicConfig,
×
767
                        tag.Error(fakeErr),
×
768
                        tag.Bool(forwardCall),
×
769
                        tag.ClientError(clientErr),
×
770
                )
×
771
                return nil, fakeErr
×
772
        }
×
773
        return resp, clientErr
×
774
}
775

776
func (c *errorInjectionClient) GetGlobalIsolationGroups(
777
        ctx context.Context,
778
        request *types.GetGlobalIsolationGroupsRequest,
779
        opts ...yarpc.CallOption,
780
) (*types.GetGlobalIsolationGroupsResponse, error) {
×
781
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
782

×
783
        var resp *types.GetGlobalIsolationGroupsResponse
×
784
        var clientErr error
×
785
        var forwardCall bool
×
786
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
787
                resp, clientErr = c.client.GetGlobalIsolationGroups(ctx, request, opts...)
×
788
        }
×
789

790
        if fakeErr != nil {
×
791
                c.logger.Error(msgInjectedFakeErr,
×
792
                        tag.AdminClientOperationGetGlobalIsolationGroups,
×
793
                        tag.Error(fakeErr),
×
794
                        tag.Bool(forwardCall),
×
795
                        tag.ClientError(clientErr),
×
796
                )
×
797
                return nil, fakeErr
×
798
        }
×
799
        return resp, clientErr
×
800
}
801

802
func (c *errorInjectionClient) UpdateGlobalIsolationGroups(
803
        ctx context.Context,
804
        request *types.UpdateGlobalIsolationGroupsRequest,
805
        opts ...yarpc.CallOption,
806
) (*types.UpdateGlobalIsolationGroupsResponse, error) {
×
807
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
808

×
809
        var resp *types.UpdateGlobalIsolationGroupsResponse
×
810
        var clientErr error
×
811
        var forwardCall bool
×
812
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
813
                resp, clientErr = c.client.UpdateGlobalIsolationGroups(ctx, request, opts...)
×
814
        }
×
815

816
        if fakeErr != nil {
×
817
                c.logger.Error(msgInjectedFakeErr,
×
818
                        tag.AdminClientOperationUpdateGlobalIsolationGroups,
×
819
                        tag.Error(fakeErr),
×
820
                        tag.Bool(forwardCall),
×
821
                        tag.ClientError(clientErr),
×
822
                )
×
823
                return nil, fakeErr
×
824
        }
×
825
        return resp, clientErr
×
826
}
827

828
func (c *errorInjectionClient) GetDomainIsolationGroups(
829
        ctx context.Context,
830
        request *types.GetDomainIsolationGroupsRequest,
831
        opts ...yarpc.CallOption,
832
) (*types.GetDomainIsolationGroupsResponse, error) {
×
833
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
834

×
835
        var resp *types.GetDomainIsolationGroupsResponse
×
836
        var clientErr error
×
837
        var forwardCall bool
×
838
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
839
                resp, clientErr = c.client.GetDomainIsolationGroups(ctx, request, opts...)
×
840
        }
×
841

842
        if fakeErr != nil {
×
843
                c.logger.Error(msgInjectedFakeErr,
×
844
                        tag.AdminClientOperationGetDomainIsolationGroups,
×
845
                        tag.Error(fakeErr),
×
846
                        tag.Bool(forwardCall),
×
847
                        tag.ClientError(clientErr),
×
848
                )
×
849
                return nil, fakeErr
×
850
        }
×
851
        return resp, clientErr
×
852
}
853

854
func (c *errorInjectionClient) UpdateDomainIsolationGroups(
855
        ctx context.Context,
856
        request *types.UpdateDomainIsolationGroupsRequest,
857
        opts ...yarpc.CallOption,
858
) (*types.UpdateDomainIsolationGroupsResponse, error) {
×
859
        fakeErr := errors.GenerateFakeError(c.errorRate)
×
860

×
861
        var resp *types.UpdateDomainIsolationGroupsResponse
×
862
        var clientErr error
×
863
        var forwardCall bool
×
864
        if forwardCall = errors.ShouldForwardCall(fakeErr); forwardCall {
×
865
                resp, clientErr = c.client.UpdateDomainIsolationGroups(ctx, request, opts...)
×
866
        }
×
867

868
        if fakeErr != nil {
×
869
                c.logger.Error(msgInjectedFakeErr,
×
870
                        tag.AdminClientOperationUpdateDomainIsolationGroups,
×
871
                        tag.Error(fakeErr),
×
872
                        tag.Bool(forwardCall),
×
873
                        tag.ClientError(clientErr),
×
874
                )
×
875
                return nil, fakeErr
×
876
        }
×
877
        return resp, clientErr
×
878
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc