mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ci-stats-reporter] use a default timeout of 60 seconds (#131428)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
94753e6487
commit
06b958d2a2
2 changed files with 14 additions and 4 deletions
|
@ -22,6 +22,8 @@ import { parseConfig, Config, CiStatsMetadata } from '@kbn/ci-stats-core';
|
|||
import type { CiStatsTestGroupInfo, CiStatsTestRun } from './ci_stats_test_group_types';
|
||||
|
||||
const BASE_URL = 'https://ci-stats.kibana.dev';
|
||||
const SECOND = 1000;
|
||||
const MINUTE = 60 * SECOND;
|
||||
|
||||
function limitMetaStrings(meta: CiStatsMetadata) {
|
||||
return Object.fromEntries(
|
||||
|
@ -107,6 +109,7 @@ interface ReqOptions {
|
|||
body: any;
|
||||
bodyDesc: string;
|
||||
query?: AxiosRequestConfig['params'];
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
/** Object that helps report data to the ci-stats service */
|
||||
|
@ -282,6 +285,7 @@ export class CiStatsReporter {
|
|||
},
|
||||
bodyDesc: `[${group.name}/${group.type}] Chunk of ${bufferBytes} bytes`,
|
||||
body: buffer.join('\n'),
|
||||
timeout: 5 * MINUTE,
|
||||
});
|
||||
buffer.length = 0;
|
||||
bufferBytes = 0;
|
||||
|
@ -336,7 +340,7 @@ export class CiStatsReporter {
|
|||
}
|
||||
}
|
||||
|
||||
private async req<T>({ auth, body, bodyDesc, path, query }: ReqOptions) {
|
||||
private async req<T>({ auth, body, bodyDesc, path, query, timeout = 60 * SECOND }: ReqOptions) {
|
||||
let attempt = 0;
|
||||
const maxAttempts = 5;
|
||||
|
||||
|
@ -365,6 +369,7 @@ export class CiStatsReporter {
|
|||
// if it can be serialized into a string, send it
|
||||
maxBodyLength: Infinity,
|
||||
maxContentLength: Infinity,
|
||||
timeout,
|
||||
});
|
||||
|
||||
return resp.data;
|
||||
|
|
11
packages/kbn-pm/dist/index.js
vendored
11
packages/kbn-pm/dist/index.js
vendored
|
@ -1580,6 +1580,8 @@ var _ciStatsCore = __webpack_require__("../../node_modules/@kbn/ci-stats-core/ta
|
|||
*/
|
||||
// @ts-expect-error not "public", but necessary to prevent Jest shimming from breaking things
|
||||
const BASE_URL = 'https://ci-stats.kibana.dev';
|
||||
const SECOND = 1000;
|
||||
const MINUTE = 60 * SECOND;
|
||||
|
||||
function limitMetaStrings(meta) {
|
||||
return Object.fromEntries(Object.entries(meta).map(([key, value]) => {
|
||||
|
@ -1782,7 +1784,8 @@ class CiStatsReporter {
|
|||
groupType: group.type
|
||||
},
|
||||
bodyDesc: `[${group.name}/${group.type}] Chunk of ${bufferBytes} bytes`,
|
||||
body: buffer.join('\n')
|
||||
body: buffer.join('\n'),
|
||||
timeout: 5 * MINUTE
|
||||
});
|
||||
buffer.length = 0;
|
||||
bufferBytes = 0;
|
||||
|
@ -1851,7 +1854,8 @@ class CiStatsReporter {
|
|||
body,
|
||||
bodyDesc,
|
||||
path,
|
||||
query
|
||||
query,
|
||||
timeout = 60 * SECOND
|
||||
}) {
|
||||
let attempt = 0;
|
||||
const maxAttempts = 5;
|
||||
|
@ -1879,7 +1883,8 @@ class CiStatsReporter {
|
|||
adapter: _http.default,
|
||||
// if it can be serialized into a string, send it
|
||||
maxBodyLength: Infinity,
|
||||
maxContentLength: Infinity
|
||||
maxContentLength: Infinity,
|
||||
timeout
|
||||
});
|
||||
return resp.data;
|
||||
} catch (error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue