Skip to content

Fiber test skill#22

Open
15168316096 wants to merge 12 commits intomainfrom
fiber-test-skill
Open

Fiber test skill#22
15168316096 wants to merge 12 commits intomainfrom
fiber-test-skill

Conversation

@15168316096
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown

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

Expands the Fiber devnet Python integration test suite around trampoline routing and one-way channel behavior, and adds a .cursor “fiber-test” skill/reference pack to document testing patterns and APIs.

Changes:

  • Refactors and significantly extends trampoline_routing tests to cover invoice/keysend trampoline flows plus several failure cases.
  • Enhances one_way channel tests with stricter negative assertions, restart behavior coverage, and shutdown scenarios.
  • Removes an obsolete/placeholder accept-channel test file and adds .cursor/skills/fiber-test/* reference documentation.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test_cases/fiber/devnet/trampoline_routing/test_allowTramponlieRouting.py Adds topology helpers and multiple trampoline routing success/failure tests (invoice + keysend).
test_cases/fiber/devnet/one_way/test_oneway_channel.py Improves one-way channel test coverage (directionality, middle-hop failure, shutdown, restart).
test_cases/fiber/devnet/accept_channel/test_accept_channel.py Deletes unused commented-out placeholder content.
.cursor/skills/fiber-test/references/test-patterns.md Adds a test pattern reference for common integration-test flows.
.cursor/skills/fiber-test/references/lightning-concepts.md Adds Fiber↔Lightning conceptual mapping reference.
.cursor/skills/fiber-test/references/gap-analysis.md Adds a detailed test coverage gap analysis document.
.cursor/skills/fiber-test/references/api-reference.md Adds a summarized Fiber RPC API reference for tests.
.cursor/skills/fiber-test/SKILL.md Adds the Cursor “fiber-test” skill definition and quick-start guidance.

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

Comment on lines +113 to +120
try:
self.wait_payment_state(self.fiber1, payment["payment_hash"], "Success")
except Exception as e:
pytest.xfail(
"pending fix: receiver should validate preimage using invoice hash_algorithm "
f"(sha256), error={str(e)}"
)

Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The xfail here triggers on any exception from wait_payment_state, which can mask unrelated failures (infra flakiness, routing bugs, RPC timeouts) as an expected failure. Consider marking the test with @pytest.mark.xfail (optionally strict=True) for the known bug, or only calling pytest.xfail when the exception matches the specific known error; otherwise re-raise so unexpected failures still fail the test.

Copilot uses AI. Check for mistakes.
Comment on lines +134 to +140
def test_trampoline_multi_hops_keysend_success(self):
self._wait_indexer_synced()
self.fiber3 = self.start_new_fiber(self._generate_account_with_retry(1000))
self.fiber3.connect_peer(self.fiber2)
self.fiber4 = self.start_new_fiber(self._generate_account_with_retry(1000))
self.fiber4.connect_peer(self.fiber3)

Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The topology setup in this test (starting fiber3/fiber4, connecting peers, opening 3 channels, waiting for graph sync) is duplicated again in test_trampoline_max_fee_amount_too_low_should_fail. Extracting a shared helper (similar to _build_tr001_topology) would reduce maintenance cost and make future topology tweaks less error-prone.

Copilot uses AI. Check for mistakes.
time.sleep(interval)
continue
raise
raise last_error
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Illegal class 'NoneType' raised; will result in a TypeError being raised instead.

Suggested change
raise last_error
if last_error is not None:
raise last_error
raise TimeoutError(f"failed to generate account after {retries} retries")

Copilot uses AI. Check for mistakes.
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