Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(clients): reduce common tests flakyness #3205

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('createIterablePromise', () => {
await expect(promise).resolves.toEqual('success #2');

expect(Date.now() - before).toBeGreaterThanOrEqual(0);
expect(Date.now() - before).toBeLessThanOrEqual(10);
expect(Date.now() - before).toBeLessThanOrEqual(20);
expect(calls).toBe(2);
});

Expand All @@ -133,7 +133,7 @@ describe('createIterablePromise', () => {
await expect(promise).resolves.toEqual('success #2');

expect(Date.now() - before).toBeGreaterThanOrEqual(2000);
expect(Date.now() - before).toBeLessThanOrEqual(2010);
expect(Date.now() - before).toBeLessThanOrEqual(2020);
expect(calls).toBe(2);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('timeout handling', () => {
const response = await requester.send({
...timeoutRequest,
connectTimeout: 1000,
url: 'http://localhost:1111/connection_timeout',
url: 'http://localhost:1113/connection_timeout',
});

const now = Date.now();
Expand All @@ -145,7 +145,7 @@ describe('timeout handling', () => {
const response = await requester.send({
...timeoutRequest,
connectTimeout: 2000,
url: 'http://localhost:1111/connection_timeout',
url: 'http://localhost:1113/connection_timeout',
});

const now = Date.now();
Expand All @@ -161,7 +161,7 @@ describe('timeout handling', () => {
const response = await requester.send({
...timeoutRequest,
responseTimeout: 2000,
url: 'http://localhost:1111',
url: 'http://localhost:1113',
});

const now = Date.now();
Expand All @@ -176,7 +176,7 @@ describe('timeout handling', () => {
const response = await requester.send({
...timeoutRequest,
responseTimeout: 3000,
url: 'http://localhost:1111',
url: 'http://localhost:1113',
});

const now = Date.now();
Expand All @@ -190,7 +190,7 @@ describe('timeout handling', () => {
const before = Date.now();
const response = await requester.send({
...requestStub,
url: 'http://localhost:1111',
url: 'http://localhost:1113',
responseTimeout: 6000,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ describe('timeout handling', () => {
const response = await requester.send({
...timeoutRequest,
connectTimeout: 1000,
url: 'http://localhost:1111/connection_timeout',
url: 'http://localhost:1112/connection_timeout',
});

const now = Date.now();
Expand All @@ -201,7 +201,7 @@ describe('timeout handling', () => {
const response = await requester.send({
...timeoutRequest,
connectTimeout: 2000,
url: 'http://localhost:1111/connection_timeout',
url: 'http://localhost:1112/connection_timeout',
});

const now = Date.now();
Expand All @@ -217,7 +217,7 @@ describe('timeout handling', () => {
const response = await requester.send({
...timeoutRequest,
responseTimeout: 2000,
url: 'http://localhost:1111',
url: 'http://localhost:1112',
});

const now = Date.now();
Expand All @@ -232,7 +232,7 @@ describe('timeout handling', () => {
const response = await requester.send({
...timeoutRequest,
responseTimeout: 3000,
url: 'http://localhost:1111',
url: 'http://localhost:1112',
});

const now = Date.now();
Expand All @@ -246,7 +246,7 @@ describe('timeout handling', () => {
const before = Date.now();
const response = await requester.send({
...requestStub,
url: 'http://localhost:1111',
url: 'http://localhost:1112',
responseTimeout: 6000,
});

Expand Down
Loading