Skip to content

Conversation

@lklimek
Copy link
Contributor

@lklimek lklimek commented Dec 17, 2025

Issue being fixed or feature implemented

When tests are killed, we want to be able to retrieve core dump and affected binary to investigate

What was done?

Extended test workflow to upload core dump and binary to github artifacts.

How Has This Been Tested?

https://github.com/dashpay/platform/actions/runs/20302691431

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • Chores
    • Improved CI failure diagnostics: test runs now enable and collect core dumps into a dedicated archive when failures occur.
    • Crash artifacts (core dumps and related binaries) are archived and uploaded as a short-retention artifact only on test failures, without affecting successful runs.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

📝 Walkthrough

Walkthrough

Updates CI workflow: adjusts direct-packages input default quoting and adds steps to configure core dumps (create /cores, set core_pattern, lift ulimit) and, on test failure, archive and upload core dumps and related binaries/dSYMs as a 3‑day artifact.

Changes

Cohort / File(s) Summary
CI crash artifact collection & input tweak
\.github/workflows/tests-rs-package.yml
Changes the default value syntax for input direct-packages from '[]' to "[]". Adds steps to configure core dumps (create /cores, set core_pattern, set unlimited ulimit) before tests, a failure-path "Collect crash artifacts" step that archives core dumps and related binaries/dSYMs into crash-artifacts/core-dumps.zip (skips if none), and an "Upload core dumps" step uploading core-dumps-${package} with 3-day retention (ignores when no files).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🐰 I hop through YAML, swift and spry,
I make a nest where core files lie,
When tests stumble, I gather and zip,
Send carrots of logs on a three-day trip,
Huzzah — debugging is nigh! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding core dump collection and upload functionality to the CI workflow when tests fail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 933af52 and 3a52d35.

📒 Files selected for processing (1)
  • .github/workflows/tests-rs-package.yml
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: lklimek
Repo: dashpay/platform PR: 2318
File: .github/workflows/tests-build-image.yml:45-45
Timestamp: 2024-11-13T10:31:30.891Z
Learning: In the dashpay/platform repository, changes to `.github/workflows/tests-build-image.yml` that switch the Docker image platform from `linux/arm64` to `linux/amd64` for testing purposes are acceptable when required to run on GitHub-hosted runners. ARM64 testing is covered on the testnet.
📚 Learning: 2024-11-08T09:27:23.601Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2316
File: .github/actions/librocksdb/action.yaml:22-28
Timestamp: 2024-11-08T09:27:23.601Z
Learning: Prefer to use `librocksdb/${{ inputs.version }}/${{ runner.os }}/${{ runner.arch }}` as the cache key for caching librocksdb in workflows; it's sufficient.

Applied to files:

  • .github/workflows/tests-rs-package.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Rust packages (wasm-sdk) / Tests
🔇 Additional comments (5)
.github/workflows/tests-rs-package.yml (5)

15-15: LGTM!

The quote style change is cosmetic and doesn't affect functionality—both single and double quotes produce valid YAML strings that fromJSON() will parse correctly.


201-206: LGTM!

The core dump configuration is appropriate for CI debugging:

  • /cores with 777 is acceptable in an ephemeral CI context
  • The pattern %e.%p.%t provides good traceability (executable, PID, timestamp)

208-211: LGTM!

Setting ulimit -c unlimited correctly enables core dump generation for the test process, which is required for the artifact collection to work.


219-252: Well-structured artifact collection.

The script is defensive and thorough:

  • Proper error handling with set -euo pipefail and shopt -s nullglob
  • Early exit when no core dumps exist (avoiding empty artifacts)
  • Correct Rust naming convention handling (-_ for binary prefixes)
  • Includes debug symbols (.dwp files) for complete debugging context

254-263: LGTM!

Good artifact upload configuration:

  • retention-days: 3 addresses the artifact cleanup concern raised in PR comments—artifacts will be automatically purged after 3 days
  • if-no-files-found: ignore correctly handles the case when the previous step exits early (no core dumps)
  • Package-specific naming prevents conflicts in matrix builds

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/tests-rs-package.yml (2)

201-206: Consider more restrictive permissions for /cores directory.

While 777 permissions work in this CI container environment, it's overly permissive. Consider using 755 or 775 instead to follow the principle of least privilege.

Apply this diff to use more restrictive permissions:

       - name: Configure core dumps
         run: |
           sudo mkdir /cores
-          sudo chmod 777 /cores
+          sudo chmod 755 /cores
           # Core filenames will be of the form executable.pid.timestamp:
           sudo bash -c 'echo "/cores/%e.%p.%t" > /proc/sys/kernel/core_pattern'

246-251: dSYM files are macOS-specific but workflow runs on Linux.

The script collects .dSYM files, which are macOS debug symbols, but this workflow runs on ubuntu-24.04. While harmless, this check is unnecessary on Linux. The .dwp files are the appropriate debug symbol format for Linux.

Apply this diff to remove unnecessary macOS-specific debug symbol handling:

-          for extra in target/debug/deps/${BIN_PREFIX}-*.dSYM target/debug/${BIN_PREFIX}.dSYM \
-                      target/debug/deps/${BIN_PREFIX}-*.dwp target/debug/${BIN_PREFIX}.dwp; do
+          for extra in target/debug/deps/${BIN_PREFIX}-*.dwp target/debug/${BIN_PREFIX}.dwp; do
             if [[ -e "$extra" ]]; then
               cp -a "$extra" "${ARTIFACT_DIR}/binaries/"
             fi
           done
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 45111c4 and 3521cc9.

📒 Files selected for processing (1)
  • .github/workflows/tests-rs-package.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: lklimek
Repo: dashpay/platform PR: 2318
File: .github/workflows/tests-build-image.yml:45-45
Timestamp: 2024-11-13T10:31:30.891Z
Learning: In the dashpay/platform repository, changes to `.github/workflows/tests-build-image.yml` that switch the Docker image platform from `linux/arm64` to `linux/amd64` for testing purposes are acceptable when required to run on GitHub-hosted runners. ARM64 testing is covered on the testnet.
📚 Learning: 2024-11-08T09:27:23.601Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2316
File: .github/actions/librocksdb/action.yaml:22-28
Timestamp: 2024-11-08T09:27:23.601Z
Learning: Prefer to use `librocksdb/${{ inputs.version }}/${{ runner.os }}/${{ runner.arch }}` as the cache key for caching librocksdb in workflows; it's sufficient.

Applied to files:

  • .github/workflows/tests-rs-package.yml
🔇 Additional comments (2)
.github/workflows/tests-rs-package.yml (2)

209-211: LGTM!

The ulimit configuration correctly enables unlimited core dump generation, which is essential for capturing crash information when tests fail.


255-264: LGTM!

The artifact upload configuration is well-designed with appropriate retention period, graceful handling of missing files, and helpful usage documentation.

@QuantumExplorer
Copy link
Member

Don't we need something that cleans these up from time to time?

@github-actions github-actions bot added this to the v3.0.0 milestone Jan 13, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/tests-rs-package.yml:
- Around line 201-206: The workflow step that configures core dump pattern
currently creates /cores and writes to /proc/sys/kernel/core_pattern but misses
enabling core dumps via ulimit; add a command to set the core file size limit to
unlimited (e.g., run ulimit -c unlimited) in the same shell where tests execute
(either add it to the "Configure core dumps" step before writing the pattern and
ensure subsequent commands run in the same shell, or place ulimit -c unlimited
at the start of the "Run tests" step) so the kernel will actually produce core
files when a crash occurs.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3521cc9 and 46cd731.

📒 Files selected for processing (1)
  • .github/workflows/tests-rs-package.yml
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: lklimek
Repo: dashpay/platform PR: 2318
File: .github/workflows/tests-build-image.yml:45-45
Timestamp: 2024-11-13T10:31:30.891Z
Learning: In the dashpay/platform repository, changes to `.github/workflows/tests-build-image.yml` that switch the Docker image platform from `linux/arm64` to `linux/amd64` for testing purposes are acceptable when required to run on GitHub-hosted runners. ARM64 testing is covered on the testnet.
📚 Learning: 2024-11-08T09:27:23.601Z
Learnt from: lklimek
Repo: dashpay/platform PR: 2316
File: .github/actions/librocksdb/action.yaml:22-28
Timestamp: 2024-11-08T09:27:23.601Z
Learning: Prefer to use `librocksdb/${{ inputs.version }}/${{ runner.os }}/${{ runner.arch }}` as the cache key for caching librocksdb in workflows; it's sufficient.

Applied to files:

  • .github/workflows/tests-rs-package.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Rust packages (wasm-sdk) / Tests
  • GitHub Check: Build JS packages / Build JS
  • GitHub Check: Rust crates security audit
🔇 Additional comments (2)
.github/workflows/tests-rs-package.yml (2)

217-251: Well-structured crash artifact collection.

The script handles edge cases properly:

  • Uses set -euo pipefail for strict error handling
  • Uses compgen -G to safely check for glob matches
  • Correctly transforms package names (- to _) to match Rust's binary naming convention
  • Includes both dSYM (macOS) and dwp (DWARF) debug symbols

One observation: dSYM files are macOS-specific and won't exist on Ubuntu runners, but including them doesn't hurt and makes the workflow portable if runners change in the future.


253-262: LGTM! Retention policy addresses cleanup concern.

The retention-days: 3 setting addresses QuantumExplorer's question about artifact cleanup—GitHub will automatically delete these artifacts after 3 days. The if-no-files-found: ignore correctly handles the case where no core dumps were produced.

@lklimek lklimek modified the milestones: v3.0.0, v3.1.0 Jan 13, 2026
@github-actions github-actions bot modified the milestones: v3.1.0, v3.0.0 Jan 13, 2026
shumkov
shumkov previously approved these changes Jan 13, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances CI test failure diagnostics by adding core dump collection capabilities to the Rust package test workflow. When tests fail and produce core dumps, the workflow now captures both the core dumps and associated binaries, archives them, and uploads them as GitHub artifacts for debugging purposes.

Changes:

  • Configure core dump generation with unlimited size and custom file naming pattern
  • Collect core dumps and test binaries on test failure
  • Upload crash artifacts as short-lived (3 days) GitHub artifacts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lklimek lklimek requested review from Copilot and shumkov January 13, 2026 15:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants