Skip to content

Commit

Permalink
[Fleet] Increase number of attempts on flaky unenroll test (#164734)
Browse files Browse the repository at this point in the history
## Summary

Closes #157205 

Add an extra attempt to this flky test.

bonus: we were rejecting with strings which was giving us this funny
error:

```
[Error: the string "action timed out" was thrown, throw an Error :)]
```
  • Loading branch information
hop-dev authored Aug 24, 2023
1 parent fda98b0 commit f2c6998
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion x-pack/test/fleet_api_integration/apis/agents/reassign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export default function (providerContext: FtrProviderContext) {
const intervalId = setInterval(async () => {
if (attempts > 2) {
clearInterval(intervalId);
reject('action timed out');
reject(new Error('action timed out'));
}
++attempts;
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function (providerContext: FtrProviderContext) {
const intervalId = setInterval(async () => {
if (attempts > 2) {
clearInterval(intervalId);
reject('action timed out');
reject(new Error('action timed out'));
}
++attempts;
const {
Expand Down
4 changes: 2 additions & 2 deletions x-pack/test/fleet_api_integration/apis/agents/unenroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ export default function (providerContext: FtrProviderContext) {
await new Promise((resolve, reject) => {
let attempts = 0;
const intervalId = setInterval(async () => {
if (attempts > 2) {
if (attempts > 3) {
clearInterval(intervalId);
reject('action timed out');
reject(new Error('action timed out'));
}
++attempts;
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function (providerContext: FtrProviderContext) {
const intervalId = setInterval(async () => {
if (attempts > 4) {
clearInterval(intervalId);
reject('action timed out');
reject(new Error('action timed out'));
}
++attempts;
const {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/fleet_api_integration/apis/agents/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ export default function (providerContext: FtrProviderContext) {
const intervalId = setInterval(async () => {
if (attempts > 4) {
clearInterval(intervalId);
reject('action timed out');
reject(new Error('action timed out'));
}
++attempts;
const {
Expand Down

0 comments on commit f2c6998

Please sign in to comment.