Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Response Ops][Test] Debugging Flaky Tests #192892

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
09b7a7f
remove not necesary test + activate logs
jcger Sep 13, 2024
65265af
rename and deactivate custom env
jcger Sep 13, 2024
da2b8c3
perf logs in tests
jcger Sep 16, 2024
cb18b1f
remove unnecessary code
jcger Sep 16, 2024
86be37e
quick_checks exit 0
jcger Sep 16, 2024
7d7cdc6
remove integration and functional test
jcger Sep 16, 2024
473bc4f
fix ts error
jcger Sep 16, 2024
c8e8db0
fix ts warnings
jcger Sep 16, 2024
cb0a9d1
reduce amount of tests + wrong var
jcger Sep 16, 2024
7d5c733
better logging
jcger Sep 16, 2024
e5e3c11
run test onceo nly
jcger Sep 16, 2024
0443ef4
skip broken test + cleaup call
jcger Sep 16, 2024
1ae3d58
remove prob unnecessary step
jcger Sep 16, 2024
23629b7
add another cleanup
jcger Sep 16, 2024
4a15624
activate react query error logs
jcger Sep 17, 2024
1dde245
remove query log + add state change logs
jcger Sep 17, 2024
536d088
wrap render fn in act + cache staleTime 0
jcger Sep 17, 2024
2f2b4b4
remove stale time
jcger Sep 17, 2024
57d7377
add stale time
jcger Sep 17, 2024
928bb4c
memo AppWrapper
jcger Sep 18, 2024
e8727c0
rollback some changes and logs
jcger Sep 18, 2024
815f1b4
remove logs + provider obj
jcger Sep 18, 2024
4232af7
reduce amount of tests
jcger Sep 18, 2024
82181f2
run all again and add cleanup to failing test
jcger Sep 18, 2024
3785472
remove logs and test all_cases suite only
jcger Oct 4, 2024
1db4a0a
just client side cases test + avoid object creation on each render in…
jcger Oct 4, 2024
1f950f3
fix faker timer messages
jcger Oct 4, 2024
611798e
run all cases + detectOpenHandles flag
jcger Oct 4, 2024
211d56c
skip test broken due to memo + refactor memo
jcger Oct 4, 2024
7d6cbb8
skip all test that use act, delete utils with act
jcger Oct 18, 2024
8d7b34b
skip another one
jcger Oct 18, 2024
e962ebf
remove memory router because why not?
jcger Oct 18, 2024
84f3708
skip test that requires memory router
jcger Oct 18, 2024
0c78c23
skip all tests with waitForNextUpdate
jcger Oct 21, 2024
520f0d8
restore memory router provider
jcger Oct 21, 2024
1b7eb80
log time passed stop fetching
jcger Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
552 changes: 274 additions & 278 deletions .buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts

Large diffs are not rendered by default.

172 changes: 86 additions & 86 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ steps:

- wait

- command: .buildkite/scripts/steps/build_kibana.sh
label: Build Kibana Distribution and Plugins
agents:
machineType: n2-standard-16
preemptible: true
key: build
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
timeout_in_minutes: 90
retry:
automatic:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/quick_checks.sh
label: 'Quick Checks'
agents:
machineType: n2-highcpu-8
preemptible: true
key: quick_checks
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3
# - command: .buildkite/scripts/steps/build_kibana.sh
# label: Build Kibana Distribution and Plugins
# agents:
# machineType: n2-standard-16
# preemptible: true
# key: build
# if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
# timeout_in_minutes: 90
# retry:
# automatic:
# - exit_status: '-1'
# limit: 3

- wait
# - command: .buildkite/scripts/steps/quick_checks.sh
# label: 'Quick Checks'
# agents:
# machineType: n2-highcpu-8
# preemptible: true
# key: quick_checks
# timeout_in_minutes: 60
# retry:
# automatic:
# - exit_status: '-1'
# limit: 3
#
# - wait

- command: .buildkite/scripts/steps/ci_stats_ready.sh
label: Mark CI Stats as ready
Expand All @@ -54,69 +54,69 @@ steps:
timeout_in_minutes: 10
env:
JEST_UNIT_SCRIPT: '.buildkite/scripts/steps/test/jest.sh'
JEST_INTEGRATION_SCRIPT: '.buildkite/scripts/steps/test/jest_integration.sh'
FTR_CONFIGS_SCRIPT: '.buildkite/scripts/steps/test/ftr_configs.sh'
# JEST_INTEGRATION_SCRIPT: '.buildkite/scripts/steps/test/jest_integration.sh'
# FTR_CONFIGS_SCRIPT: '.buildkite/scripts/steps/test/ftr_configs.sh'
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
agents:
machineType: n2-standard-8
preemptible: true
key: linting
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/check_types.sh
label: 'Check Types'
agents:
machineType: n2-standard-4
preemptible: true
key: check_types
timeout_in_minutes: 70
retry:
automatic:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/lint_with_types.sh
label: 'Linting (with types)'
agents:
machineType: n2-standard-16
preemptible: true
key: linting_with_types
timeout_in_minutes: 90
retry:
automatic:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/checks.sh
label: 'Checks'
key: checks
agents:
machineType: n2-standard-2
preemptible: true
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/api_docs/build_api_docs.sh
label: 'Build API Docs'
agents:
machineType: n2-standard-4
preemptible: true
key: build_api_docs
timeout_in_minutes: 90
retry:
automatic:
- exit_status: '-1'
limit: 3
# - command: .buildkite/scripts/steps/lint.sh
# label: 'Linting'
# agents:
# machineType: n2-standard-8
# preemptible: true
# key: linting
# timeout_in_minutes: 60
# retry:
# automatic:
# - exit_status: '-1'
# limit: 3
#
# - command: .buildkite/scripts/steps/check_types.sh
# label: 'Check Types'
# agents:
# machineType: n2-standard-4
# preemptible: true
# key: check_types
# timeout_in_minutes: 70
# retry:
# automatic:
# - exit_status: '-1'
# limit: 3
#
# - command: .buildkite/scripts/steps/lint_with_types.sh
# label: 'Linting (with types)'
# agents:
# machineType: n2-standard-16
# preemptible: true
# key: linting_with_types
# timeout_in_minutes: 90
# retry:
# automatic:
# - exit_status: '-1'
# limit: 3
#
# - command: .buildkite/scripts/steps/checks.sh
# label: 'Checks'
# key: checks
# agents:
# machineType: n2-standard-2
# preemptible: true
# timeout_in_minutes: 60
# retry:
# automatic:
# - exit_status: '-1'
# limit: 3
#
# - command: .buildkite/scripts/steps/api_docs/build_api_docs.sh
# label: 'Build API Docs'
# agents:
# machineType: n2-standard-4
# preemptible: true
# key: build_api_docs
# timeout_in_minutes: 90
# retry:
# automatic:
# - exit_status: '-1'
# limit: 3
40 changes: 20 additions & 20 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,26 @@ const getPipeline = (filename: string, removeSteps = true) => {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/kbn_handlebars.yml'));
}

if (
(await doAnyChangesMatch([
/^src\/plugins\/data/,
/^x-pack\/plugins\/actions/,
/^x-pack\/plugins\/alerting/,
/^x-pack\/plugins\/event_log/,
/^x-pack\/plugins\/rule_registry/,
/^x-pack\/plugins\/task_manager/,
])) ||
GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/response_ops.yml'));
}

if (
(await doAnyChangesMatch([/^x-pack\/plugins\/cases/])) ||
GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/response_ops_cases.yml'));
}
// if (
// (await doAnyChangesMatch([
// /^src\/plugins\/data/,
// /^x-pack\/plugins\/actions/,
// /^x-pack\/plugins\/alerting/,
// /^x-pack\/plugins\/event_log/,
// /^x-pack\/plugins\/rule_registry/,
// /^x-pack\/plugins\/task_manager/,
// ])) ||
// GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
// ) {
// pipeline.push(getPipeline('.buildkite/pipelines/pull_request/response_ops.yml'));
// }

// if (
// (await doAnyChangesMatch([/^x-pack\/plugins\/cases/])) ||
// GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
// ) {
// pipeline.push(getPipeline('.buildkite/pipelines/pull_request/response_ops_cases.yml'));
// }

if (
(await doAnyChangesMatch([
Expand Down
13 changes: 7 additions & 6 deletions .buildkite/scripts/steps/quick_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

set -euo pipefail

if [[ "${CI:-}" =~ ^(1|true)$ ]]; then
export DISABLE_BOOTSTRAP_VALIDATION=false
.buildkite/scripts/bootstrap.sh
fi

node scripts/quick_checks --file .buildkite/scripts/steps/checks/quick_checks.txt
# if [[ "${CI:-}" =~ ^(1|true)$ ]]; then
# export DISABLE_BOOTSTRAP_VALIDATION=false
# .buildkite/scripts/bootstrap.sh
# fi
#
# node scripts/quick_checks --file .buildkite/scripts/steps/checks/quick_checks.txt
exit 0
80 changes: 40 additions & 40 deletions .buildkite/scripts/steps/test/jest_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,51 +53,51 @@ echo "
of noise on CI without any percevable benefit, so they have been disabled. If you want to log
output in your test temporarily, you can modify 'packages/kbn-test/src/jest/setup/disable_console_logs.js'
"
# while read -r config; do
config="x-pack/plugins/cases/jest.config.js"
echo "--- $ node scripts/jest --config $config"

# --trace-warnings to debug
# Node.js process-warning detected:
# Warning: Closing file descriptor 24 on garbage collection
cmd="NODE_OPTIONS=\"--max-old-space-size=12288 --trace-warnings\" node ./scripts/jest --config=\"$config\" $parallelism --coverage=false --passWithNoTests --detectOpenHandles"
echo "actual full command is:"
echo "$cmd"
echo ""

while read -r config; do
echo "--- $ node scripts/jest --config $config"

# --trace-warnings to debug
# Node.js process-warning detected:
# Warning: Closing file descriptor 24 on garbage collection
cmd="NODE_OPTIONS=\"--max-old-space-size=12288 --trace-warnings\" node ./scripts/jest --config=\"$config\" $parallelism --coverage=false --passWithNoTests"
echo "actual full command is:"
echo "$cmd"
echo ""

start=$(date +%s)

# prevent non-zero exit code from breaking the loop
set +e;
eval "$cmd"
lastCode=$?
set -e;

timeSec=$(($(date +%s)-start))
if [[ $timeSec -gt 60 ]]; then
min=$((timeSec/60))
sec=$((timeSec-(min*60)))
duration="${min}m ${sec}s"
else
duration="${timeSec}s"
fi
start=$(date +%s)

results+=("- $config
duration: ${duration}
result: ${lastCode}")
# prevent non-zero exit code from breaking the loop
set +e
eval "$cmd"
lastCode=$?
set -e

if [ $lastCode -ne 0 ]; then
exitCode=10
echo "Jest exited with code $lastCode"
echo "^^^ +++"
timeSec=$(($(date +%s) - start))
if [[ $timeSec -gt 60 ]]; then
min=$((timeSec / 60))
sec=$((timeSec - (min * 60)))
duration="${min}m ${sec}s"
else
duration="${timeSec}s"
fi

if [[ "$failedConfigs" ]]; then
failedConfigs="${failedConfigs}"$'\n'"$config"
else
failedConfigs="$config"
fi
results+=("- $config
duration: ${duration}
result: ${lastCode}")

if [ $lastCode -ne 0 ]; then
exitCode=10
echo "Jest exited with code $lastCode"
echo "^^^ +++"

if [[ "$failedConfigs" ]]; then
failedConfigs="${failedConfigs}"$'\n'"$config"
else
failedConfigs="$config"
fi
done <<< "$configs"
fi
# done <<< "$configs"

if [[ "$failedConfigs" ]]; then
buildkite-agent meta-data set "$FAILED_CONFIGS_KEY" "$failedConfigs"
Expand Down
6 changes: 3 additions & 3 deletions packages/kbn-test/src/jest/setup/disable_console_logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
*/

// on CI these logs just muddy up the console and produce a ton of unnecessary noise
console.log = () => {};
console.error = () => {};
console.warn = () => {};
// console.log = () => {};
// console.error = () => {};
// console.warn = () => {};
Loading