Skip to content

Commit 9b14657

Browse files
[9.1] [CI] Use process.uptime() for FTR duration (elastic#242354) (elastic#242533)
# Backport This will backport the following commits from `main` to `9.1`: - [[CI] Use process.uptime() for FTR duration (elastic#242354)](elastic#242354) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Dario Gieselaar","email":"dario.gieselaar@elastic.co"},"sourceCommit":{"committedDate":"2025-11-11T12:19:51Z","message":"[CI] Use process.uptime() for FTR duration (elastic#242354)\n\nCurrently for test duration, we track the time between when the tests\nare starting until the tests finish, but this ignores Elasticsearch and\nKibana start times. This is a 2-3m overhead which leads to inefficient\nbalancing of tests. This PR uses process.uptime() instead, which is a\nmore accurate representation of how long it takes to run a config.","sha":"8a953af813bd6674431154f4eaa94a4b4489eec6","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.3.0"],"title":"[CI] Use process.uptime() for FTR duration","number":242354,"url":"https://github.com/elastic/kibana/pull/242354","mergeCommit":{"message":"[CI] Use process.uptime() for FTR duration (elastic#242354)\n\nCurrently for test duration, we track the time between when the tests\nare starting until the tests finish, but this ignores Elasticsearch and\nKibana start times. This is a 2-3m overhead which leads to inefficient\nbalancing of tests. This PR uses process.uptime() instead, which is a\nmore accurate representation of how long it takes to run a config.","sha":"8a953af813bd6674431154f4eaa94a4b4489eec6"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/242354","number":242354,"mergeCommit":{"message":"[CI] Use process.uptime() for FTR duration (elastic#242354)\n\nCurrently for test duration, we track the time between when the tests\nare starting until the tests finish, but this ignores Elasticsearch and\nKibana start times. This is a 2-3m overhead which leads to inefficient\nbalancing of tests. This PR uses process.uptime() instead, which is a\nmore accurate representation of how long it takes to run a config.","sha":"8a953af813bd6674431154f4eaa94a4b4489eec6"}}]}] BACKPORT--> Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
1 parent 6e0af58 commit 9b14657

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ export async function pickTestGroupRunOrder() {
422422
queue,
423423
maxMin: FUNCTIONAL_MAX_MINUTES,
424424
minimumIsolationMin: FUNCTIONAL_MINIMUM_ISOLATION_MIN,
425-
overheadMin: 1.5,
425+
overheadMin: 0,
426426
names,
427427
})),
428428
],

src/platform/packages/shared/kbn-test/src/functional_test_runner/lib/mocha/reporter/ci_stats_ftr_reporter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function setupCiStatsFtrTestGroupReporter({
6262
const start = Date.now();
6363
const group: CiStatsReportTestsOptions['group'] = {
6464
startTime: new Date(start).toJSON(),
65-
durationMs: 0,
65+
durationMs: process.uptime() * 1000,
6666
type: testGroupType,
6767
name: Path.relative(REPO_ROOT, config.path),
6868
result: 'skip',
@@ -136,7 +136,7 @@ export function setupCiStatsFtrTestGroupReporter({
136136
}
137137

138138
// update the durationMs
139-
group.durationMs = Date.now() - startMs;
139+
group.durationMs = process.uptime() * 1000;
140140
group.result = failCount ? 'fail' : passCount ? 'pass' : 'skip';
141141
});
142142

0 commit comments

Comments
 (0)