Skip to content

Commit d5d8506

Browse files
committed
refactor
1 parent 521eb55 commit d5d8506

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

src/platform/packages/shared/kbn-esql-language/src/language/validation/integration_tests/errors.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import { readFile } from 'fs/promises';
1111
import { join } from 'path';
1212
import {
13-
setupEsqlEnv,
1413
runClientValidation,
14+
setupEsqlEnv,
1515
type EsqlEnv,
1616
type EsqlValidationFixtures,
1717
} from './helpers';
@@ -39,7 +39,8 @@ describe('ES|QL validation error integration', () => {
3939
)}\n`
4040
);
4141
}
42-
await esqlEnv?.integrationEnv.shutdown();
42+
await esqlEnv?.cleanup();
43+
await esqlEnv?.integrationEnv.stop();
4344
});
4445

4546
it('does not report client-side validation errors for queries accepted by Elasticsearch', async () => {

src/platform/packages/shared/kbn-esql-language/src/language/validation/integration_tests/helpers.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ const createIndexRequest = (index: string, fieldList: Array<{ name: string; type
114114
export const runClientValidation = (query: string) => validateQuery(query, getCallbackMocks());
115115

116116
const setupIntegrationEnv = async () => {
117+
// ES-only: we spin up a local ES test cluster without Kibana.
118+
// Faster startup and fewer moving parts, while still validating against real ES responses.
117119
const es = createTestEsCluster({
118120
license: 'basic',
119121
log: new ToolingLog({
@@ -122,17 +124,21 @@ const setupIntegrationEnv = async () => {
122124
}),
123125
});
124126

127+
// The ES test cluster startup time varies a lot in CI; align Jest timeout
128+
// with the cluster's own start timeout plus some buffer.
129+
jest.setTimeout(es.getStartTimeout() + 100_000);
130+
125131
await es.start();
126132

127133
const esClient = es.getClient();
128-
const shutdown = async () => {
134+
const stop = async () => {
129135
await es.cleanup();
130136
};
131137

132138
return {
133139
es,
134140
esClient,
135-
shutdown,
141+
stop,
136142
};
137143
};
138144

0 commit comments

Comments
 (0)