Skip to content

Commit

Permalink
Fixes Failing test: Jest Integration Tests.x-pack/plugins/task_manage…
Browse files Browse the repository at this point in the history
…r/server/integration_tests - unrecognized task types should be no workload aggregator errors when there are removed task types (#195496)

Resolves #194208

## Summary

The original integration test was checking for the (non) existence of
any error logs on startup when there are removed task types, which was
not specific enough because there were occasionally error logs like

```
"Task SLO:ORPHAN_SUMMARIES-CLEANUP-TASK \"SLO:ORPHAN_SUMMARIES-CLEANUP-TASK:1.0.0\" failed: ResponseError: search_phase_execution_exception
```

so this PR updates the integration test to check specifically for
workload aggregator error logs

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
ymao1 and elasticmachine authored Oct 9, 2024
1 parent 9221ab1 commit 742cd13
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,15 @@ describe('unrecognized task types', () => {
// so we want to wait that long to let it refresh
await new Promise((r) => setTimeout(r, 5100));

expect(errorLogSpy).not.toHaveBeenCalled();
const errorLogCalls = errorLogSpy.mock.calls[0];

// if there are any error logs, none of them should be workload aggregator errors
if (errorLogCalls) {
// should be no workload aggregator errors
for (const elog of errorLogCalls) {
expect(elog).not.toMatch(/^\[WorkloadAggregator\]: Error: Unsupported task type/i);
}
}
});
});

Expand Down

0 comments on commit 742cd13

Please sign in to comment.