Fix CI: use CKB v0.204.0 (v0.205.0 does not exist)#122
Draft
Conversation
- Create test_cases/ckb_command/ with __init__.py and test_export_import.py
- Fix _export_blocks() to use per-range subdirectory to avoid EEXIST when ckb
export is called multiple times with the same target directory
- Add glob fallback to find the actual exported .jsonl file (ckb export uses
ckb_dev-{from}-{to}.jsonl naming) and rename it to the expected name
Co-authored-by: 15168316096 <45781590+15168316096@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix export command errors in integration tests
Fix ckb export EEXIST collision and filename mismatch in integration tests
Mar 10, 2026
Copilot stopped work on behalf of
15168316096 due to an error
March 10, 2026 03:19
…ts in Makefile Co-authored-by: 15168316096 <45781590+15168316096@users.noreply.github.com>
Copilot
AI
changed the title
Fix ckb export EEXIST collision and filename mismatch in integration tests
Fix CI: add CKB 0.205.0 to download list and include ckb_command tests
Mar 10, 2026
…eases) Co-authored-by: 15168316096 <45781590+15168316096@users.noreply.github.com>
Copilot
AI
changed the title
Fix CI: add CKB 0.205.0 to download list and include ckb_command tests
Fix CI: use CKB v0.204.0 (v0.205.0 does not exist)
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI was failing during
make preparebecausedownload.pyreferencedv0.205.0, which does not exist on GitHub releases (404). The latest release isv0.204.0.Changes
download.py: Remove"0.205.0"from versions listframework/test_node.py: PointCURRENT_TEST,TESTNET,CURRENT_MAIN, andPREVIEW_DUMMYbinary paths atdownload/0.204.0prepare.sh: Copyckb-clifromdownload/0.204.0Makefile: Addtest_cases/ckb_commandto the test suite so the export/import tests are executed in CIOriginal prompt
Problem
The CI integration tests in
test_cases/ckb_command/test_export_import.pyare failing with 8 out of 11 tests broken. The failing job logs: https://github.com/cryptape/ckb-py-integration-test/actions/runs/22847094649Root Cause
The
ckb exportcommand refuses to export when the target directory already contains files, throwing:The
_export_blocks()helper method exports all ranges to the same sharedexport/directory. Whentest_01exports blocks 1-50, it creates a file inexport/. Whentest_02tries to export blocks 1-10 to the same directory,ckb exportsees the existing file and fails withEEXIST. This cascades to all subsequent tests.Two failure modes observed
Export tests (test_01, test_02, test_03): The export command fails or the expected output filename
ckb-{from}-{to}.jsonldoesn't match whatckb exportactually generates, resulting inFileNotFoundError/AssertionError: File not found.Import tests (test_05, test_07, test_08, test_09, test_10): These call
_export_blocks(1, 50)again. Since the expected file doesn't exist (wrong name or previous failure), the cache check (if os.path.exists(expected)) fails, and it tries to re-export into the already-populated directory, triggeringEEXIST.Required Fix
Modify the
_export_blocks()method intest_cases/ckb_command/test_export_import.pyto use a separate subdirectory per block range for each export operation. This avoids theEEXISTconflict because eachckb exportcall gets its own clean target directory.Current code (lines 60-69):
Should be changed to use a per-range subdirectory:
Additionally, if
ckb exportgenerates a file with a different naming convention thanckb-{from}-{to}.jsonl, the method should discover the actual output file. Add a fallback usingglobto find the exported.jsonlfile in the range directory and rename/return it:Only the file
test_cases/ckb_command/test_export_import.pyneeds to be changed. The_export_blocksmethod is the only place that needs modification.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: 帮我分析一下这个报错,解决一下这个问题
Assistant: ## 分析报告
问题根因
这次 CI 失败的 核心原因 是:
ckb export命令在导出时,目标目录(export/)中已经存在同名文件,导致报错:这个错误是 Linux 系统错误码
EEXIST (17),意味着ckb export不支持覆盖已有文件,而测试代码中多个测试方法尝试导出相同 block 范围到同一个目录。失败分为两类
第 1 类:前 3 个 export 测试(test_01、test_02、test_03)
这些测试调用
_export_blocks()进行导出,但导出命令本身静默失败了(exit code 非 0 抛出异常被忽略了,或者第一次就已经失败)。导出文件没有被成功创建,后续断言找不到文件:关键线索:
_export_blocks()方法里有一个短路逻辑: