@@ -41,6 +41,18 @@ function getRunGroups(bk: BuildkiteClient, allTypes: RunGroup[], typeName: strin
4141 throw new Error ( `missing test group run order for group [${ typeName } ]` ) ;
4242 }
4343
44+ const uniqueTooLongMin = [
45+ ...new Set (
46+ types . map ( ( t ) => t . tooLongMin ) . filter ( ( value ) : value is number => typeof value === 'number' )
47+ ) ,
48+ ] ;
49+ const tooLongThresholdLabel =
50+ uniqueTooLongMin . length > 0
51+ ? `configured warning threshold${
52+ uniqueTooLongMin . length === 1 ? ` of ${ uniqueTooLongMin [ 0 ] } minutes` : ''
53+ } `
54+ : 'maximum amount of time desired for a single CI job' ;
55+
4456 const misses = types . flatMap ( ( t ) => t . namesWithoutDurations ) ;
4557 if ( misses . length > 0 ) {
4658 bk . setAnnotation (
@@ -70,10 +82,10 @@ function getRunGroups(bk: BuildkiteClient, allTypes: RunGroup[], typeName: strin
7082 'warning' ,
7183 [
7284 tooLongs . length === 1
73- ? `The following "${ typeName } " config has a duration that exceeds the maximum amount of time desired for a single CI job . ` +
85+ ? `The following "${ typeName } " config has a duration that exceeds the ${ tooLongThresholdLabel } . ` +
7486 `This is not an error, and if you don't own this config then you can ignore this warning. ` +
7587 `If you own this config please split it up ASAP and ask Operations if you have questions about how to do that.`
76- : `The following "${ typeName } " configs have durations that exceed the maximum amount of time desired for a single CI job . ` +
88+ : `The following "${ typeName } " configs have durations that exceed the ${ tooLongThresholdLabel } . ` +
7789 `This is not an error, and if you don't own any of these configs then you can ignore this warning.` +
7890 `If you own any of these configs please split them up ASAP and ask Operations if you have questions about how to do that.` ,
7991 '' ,
@@ -233,6 +245,10 @@ export async function pickTestGroupRunOrder() {
233245 throw new Error ( `invalid FUNCTIONAL_MAX_MINUTES: ${ process . env . FUNCTIONAL_MAX_MINUTES } ` ) ;
234246 }
235247
248+ const JEST_UNIT_TOO_LONG_MINUTES = 27 ;
249+ const JEST_INTEGRATION_TOO_LONG_MINUTES = 27 ;
250+ const FUNCTIONAL_TOO_LONG_MINUTES = 27 ;
251+
236252 /**
237253 * This env variable corresponds to the env stanza within
238254 * https://github.com/elastic/kibana/blob/bc2cb5dc613c3d455a5fed9c54450fd7e46ffd92/.buildkite/pipelines/code_coverage/daily.yml#L17
@@ -416,6 +432,7 @@ export async function pickTestGroupRunOrder() {
416432 type : UNIT_TYPE ,
417433 defaultMin : 4 ,
418434 maxMin : JEST_MAX_MINUTES ,
435+ tooLongMin : JEST_UNIT_TOO_LONG_MINUTES ,
419436 overheadMin : 0.2 ,
420437 warmupMin : 4 ,
421438 names : jestUnitConfigs ,
@@ -424,6 +441,7 @@ export async function pickTestGroupRunOrder() {
424441 type : INTEGRATION_TYPE ,
425442 defaultMin : 60 ,
426443 maxMin : JEST_MAX_MINUTES ,
444+ tooLongMin : JEST_INTEGRATION_TOO_LONG_MINUTES ,
427445 overheadMin : 0.2 ,
428446 warmupMin : 2 ,
429447 names : jestIntegrationConfigs ,
@@ -433,6 +451,7 @@ export async function pickTestGroupRunOrder() {
433451 defaultMin : 60 ,
434452 queue,
435453 maxMin : FUNCTIONAL_MAX_MINUTES ,
454+ tooLongMin : FUNCTIONAL_TOO_LONG_MINUTES ,
436455 minimumIsolationMin : FUNCTIONAL_MINIMUM_ISOLATION_MIN ,
437456 overheadMin : 0 ,
438457 warmupMin : 3 ,
0 commit comments