-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make readWithPit integration tests less sensitive to ES response size #180261
Changes from 1 commit
a12f671
94dd2ee
21c18d9
1b5e539
fcb234d
48d16dc
e52d8c2
91f8504
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1311,8 +1311,14 @@ describe('migration actions', () => { | |
maxResponseSizeBytes: 500, // set a small size to force the error | ||
}); | ||
const rightResponse = (await readWithPitTask()) as Either.Right<ReadWithPit>; | ||
|
||
await expect(Either.isRight(rightResponse)).toBe(true); | ||
if (Either.isRight(rightResponse)) { | ||
await expect(Either.isRight(rightResponse)).toBe(true); | ||
} else { | ||
console.log( | ||
'got a left: ', | ||
(rightResponse as Either.Left<EsResponseTooLargeError>).left.type | ||
); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should also fail the test. Perhaps this logic could be: const rightResponse = await readWithPitTask()
if (Either.isLeft(rightResponse)) {
fail(`Expected a successful response but got ${rightResponse.left}`);
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah this was meant as a throw-away debugging PR but CI won't run when there's console.log's and I think it'd be better for the future to have your suggestion, should be enough to find the cause. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, it looks like my suggestion was wrong, the |
||
|
||
readWithPitTask = readWithPit({ | ||
client, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this should be reverted?