File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -77,3 +77,30 @@ func TestBatchWriterTimeExceeded(t *testing.T) {
77
77
t .Fatal ("Batcher did not write when time exceeded" )
78
78
}
79
79
}
80
+
81
+ func TestBatchWriterFailed (t * testing.T ) {
82
+ configString := bytes .NewBufferString (`
83
+ my_stream:
84
+ name: test-stream
85
+ partition_key: value
86
+ region: us-west-1
87
+ ` )
88
+ c , _ := NewConfigFromFile (configString )
89
+ config , _ := c .ConfigForName ("my_stream" )
90
+
91
+ r := Record (map [string ]interface {}{"value" : "test-value" })
92
+ w := NewTestWriter (config , & FailingKinesisService {}, 1 )
93
+ bw := NewBatchWriterSize (w , 1 , 1 * time .Hour )
94
+ bw .WriteRecords (r )
95
+
96
+ // wait for write -- this is technically a race condition
97
+ time .Sleep (1 * time .Millisecond )
98
+
99
+ select {
100
+ case <- bw .Errors ():
101
+ // expected behavior
102
+ default :
103
+ t .Fatal ("Write did not fail as expected" )
104
+ }
105
+
106
+ }
You can’t perform that action at this time.
0 commit comments