Skip to content

Commit

Permalink
[esArchiver/test] use different lengths for random to ensure unique v…
Browse files Browse the repository at this point in the history
…alues (#20857)

fixes #20741

Rather than just generate random words with the default length of 2, generate a random 5 letter word for the type to filter by and 10 letter words for the other types, so there will never be more than 3 records with `type1`.
  • Loading branch information
Spencer authored Jul 16, 2018
1 parent c488f7e commit 4f867a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/es_archiver/lib/records/__tests__/filter_records_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ describe('esArchiver: createFilterRecordsStream()', () => {
});

it('produces record values that have a matching type', async () => {
const type1 = chance.word();
const type1 = chance.word({ length: 5 });
const output = await createPromiseFromStreams([
createListStream([
{ type: type1, value: {} },
{ type: type1, value: {} },
{ type: chance.word(), value: {} },
{ type: chance.word(), value: {} },
{ type: chance.word({ length: 10 }), value: {} },
{ type: chance.word({ length: 10 }), value: {} },
{ type: type1, value: {} },
{ type: chance.word(), value: {} },
{ type: chance.word(), value: {} },
{ type: chance.word({ length: 10 }), value: {} },
{ type: chance.word({ length: 10 }), value: {} },
]),
createFilterRecordsStream(type1),
createConcatStream([]),
Expand Down

0 comments on commit 4f867a2

Please sign in to comment.