Skip to content

Fix CI artifact conflicts, test lifecycle methods, and add UDT funding error tests#20

Draft
Copilot wants to merge 5 commits intooneway_channelfrom
copilot/sub-pr-17
Draft

Fix CI artifact conflicts, test lifecycle methods, and add UDT funding error tests#20
Copilot wants to merge 5 commits intooneway_channelfrom
copilot/sub-pr-17

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 9, 2026

Code review of PR #17 identified three issues: duplicate CI artifact names causing upload conflicts, incorrect pytest lifecycle method naming, and undocumented test framework behavior. Additionally, comprehensive test cases were added for UDT funding error handling based on fiber PR #1253.

Changes

CI Workflow (.github/workflows/fiber.yml)

  • Fixed artifact name collisions in fiber_test_trampoline_routing_one_way and fiber_test_compatibility jobs
  • Each job now uploads to uniquely named artifacts for independent failure debugging

Test Lifecycle Methods

  • Renamed setUp() to setup_method(self, method) in:
    • test_cases/fiber/devnet/send_payment/params/test_fee.py
    • test_cases/fiber/devnet/trampoline_routing/test_fee_rate.py
    • test_cases/fiber/devnet/trampoline_routing/test_boundary_values.py
  • Ensures pytest correctly invokes setup logic in SharedFiberTest subclasses

Documentation (framework/basic_fiber.py)

  • Added inline comments explaining intentionally high max_fee_rate values (1000000000000000)
  • Clarifies test framework disables fee protection to isolate functionality under test
send_payment_params = {
    "invoice": invoice["invoice_address"],
    "allow_self_payment": True,
    "max_parts": hex(12),
    # Extremely high max_fee_rate to avoid test failures due to fees
    # Production code should use reasonable values (default is 5 = 0.5%)
    "max_fee_rate": hex(1000000000000000),
}

Code Formatting

  • Applied black formatting to test_settle_invoice_edge_cases.py

New Test Cases (test_cases/fiber/devnet/fnn-cli/)

  • Added comprehensive regression tests for UDT funding error handling (fiber PR #1253)
  • test_udt_funding_errors.py: Tests for insufficient cells, retry mechanisms, and stuck channel prevention
  • test_funding_error_classification.py: Tests for error classification (temporary vs non-temporary), backoff mechanisms, and edge cases
  • Tests verify that UDT channels don't get stuck in NEGOTIATING_FUNDING state when cells are not yet indexed
  • Validates proper error handling: InsufficientCells (aborts immediately) vs AbsentTx (retries with backoff)

Security

No vulnerabilities detected by CodeQL scan.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update to address feedback on one-way channel PR Fix CI artifact conflicts and test lifecycle methods in PR #17 Feb 9, 2026
Copilot AI requested a review from 15168316096 February 9, 2026 11:01
@15168316096
Copy link
Copy Markdown
Collaborator

@copilot 帮我回归一下这个pr,先弄清楚这个pr的修改的目的,nervosnetwork/fiber#1253
然后再补充测试case,case补充到fnn-cli的目录下

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 8, 2026

@copilot 帮我回归一下这个pr,先弄清楚这个pr的修改的目的,nervosnetwork/fiber#1253
然后再补充测试case,case补充到fnn-cli的目录下

已完成测试用例补充(commit e354c8e

理解的PR目的

fiber PR #1253 修复了UDT通道在UDT cells未被索引时卡在negotiating状态的问题:

修复内容:

  • 添加 FundingError::InsufficientCells 非临时错误,直接中止通道
  • AbsentTx 重新分类为临时错误,通过退避机制重试
  • 改进错误映射,将UDT相关的TxBuilderError转换为InsufficientCells
  • 防止通道永久卡在NEGOTIATING_FUNDING状态

已添加的测试用例

test_cases/fiber/devnet/fnn-cli/ 目录下创建了两个测试文件:

test_udt_funding_errors.py - 主要回归测试:

  1. test_udt_channel_with_insufficient_cells_should_fail - 验证cells不足时立即失败
  2. test_udt_channel_funding_retry_on_indexing_delay - 测试索引延迟时的重试机制
  3. test_udt_channel_does_not_stuck_in_negotiating - 核心回归测试,确保通道不会卡住
  4. test_multiple_udt_channels_concurrent_funding - 并发资金场景测试

test_funding_error_classification.py - 错误处理测试:

  1. test_insufficient_cells_aborts_channel - 验证非临时错误立即中止
  2. test_funding_error_messages_are_clear - 确保错误消息清晰可理解
  3. test_channel_state_transitions_on_funding_errors - 测试状态转换正确性
  4. test_retry_backoff_mechanism - 验证指数退避重试机制
  5. 边界条件测试

所有测试用例已通过语法检查和代码格式化。

Copilot AI changed the title Fix CI artifact conflicts and test lifecycle methods in PR #17 Fix CI artifact conflicts, test lifecycle methods, and add UDT funding error tests Apr 8, 2026
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.

2 participants