Skip to content

Commit d19540d

Browse files
authored
[DSM] Add a wait for active stream to the putTestRecords function which was flaking when the stream was inactive (#5202)
1 parent d3ef34e commit d19540d

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

packages/datadog-plugin-aws-sdk/test/kinesis_helpers.js

+19-17
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,25 @@ function putTestRecord (kinesis, streamName, data, cb) {
5555
}
5656

5757
function putTestRecords (kinesis, streamName, cb) {
58-
kinesis.putRecords({
59-
Records: [
60-
{
61-
PartitionKey: id().toString(),
62-
Data: dataBufferCustom(1)
63-
},
64-
{
65-
PartitionKey: id().toString(),
66-
Data: dataBufferCustom(2)
67-
},
68-
{
69-
PartitionKey: id().toString(),
70-
Data: dataBufferCustom(3)
71-
}
72-
],
73-
StreamName: streamName
74-
}, cb)
58+
waitForActiveStream(kinesis, streamName, () => {
59+
kinesis.putRecords({
60+
Records: [
61+
{
62+
PartitionKey: id().toString(),
63+
Data: dataBufferCustom(1)
64+
},
65+
{
66+
PartitionKey: id().toString(),
67+
Data: dataBufferCustom(2)
68+
},
69+
{
70+
PartitionKey: id().toString(),
71+
Data: dataBufferCustom(3)
72+
}
73+
],
74+
StreamName: streamName
75+
}, cb)
76+
})
7577
}
7678

7779
function waitForActiveStream (kinesis, streamName, cb) {

0 commit comments

Comments
 (0)