Skip to content

refactor(coprocessor): improves test coverage on host-listener#2119

Merged
mergify[bot] merged 8 commits intomainfrom
panos/improve-host-listener-test-coverage
Mar 26, 2026
Merged

refactor(coprocessor): improves test coverage on host-listener#2119
mergify[bot] merged 8 commits intomainfrom
panos/improve-host-listener-test-coverage

Conversation

@PanGan21
Copy link
Copy Markdown
Contributor

Summary

Adds unit tests on host-listener files:
reorgs

  • test_get_missing_ancestors_shallow_reorg — walk back to a known ancestor
  • test_get_missing_ancestors_deep_reorg — walk back blocks through a long gap
  • test_get_missing_ancestors_beyond_max_depth — stop at max depth limit
  • test_check_missing_ancestors_not_ready — skip reorg detection when history < configured blocks

dependence chains

  • test_dependence_chains_empty_logs — empty input returns no chains
  • test_dependence_chains_across_blocks_false — past dependency ignored when across-blocks flag is off
  • test_dependence_chains_connex_two_past_chains_merge — two past chains merge in connex mode

slow lane

  • classify_slow_disconnected_components_at_threshold_are_fast — exactly at-threshold chains are not slow
  • classify_slow_single_chain_at_boundary — slow lane condition is respected
  • propagate_slow_lane_non_linear_dependency — non linear DAG

health check

  • is_alive_after_blockchain_tick_update — alive after blockchain tick
  • is_alive_after_timeout_tick_update — alive after timeout tick
  • is_alive_after_database_tick_update — alive after database tick
  • is_alive_after_all_ticks_update — alive after all ticks
  • is_alive_at_creation — alive at creation

Closes: https://github.com/zama-ai/fhevm-internal/issues/1155

@PanGan21 PanGan21 requested a review from a team as a code owner March 16, 2026 12:01
@cla-bot cla-bot bot added the cla-signed label Mar 16, 2026
@PanGan21 PanGan21 changed the title refactor(coprocessor): Improves test coverage on host-listener refactor(coprocessor): improves test coverage on host-listener Mar 16, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 16, 2026

Changed Lines Coverage

Coverage of added/modified lines: 97.0%

Per-file breakdown

Diff Coverage

Diff: origin/main...HEAD, staged and unstaged changes

  • coprocessor/fhevm-engine/fhevm-engine-common/src/utils.rs (100%)
  • coprocessor/fhevm-engine/host-listener/src/cmd/mod.rs (100%)
  • coprocessor/fhevm-engine/host-listener/src/database/dependence_chains.rs (100%)
  • coprocessor/fhevm-engine/host-listener/src/database/ingest.rs (89.7%): Missing lines 495,513,523,543,547,551
  • coprocessor/fhevm-engine/host-listener/src/health_check.rs (100%)

Summary

  • Total: 259 lines
  • Missing: 6 lines
  • Coverage: 97%

coprocessor/fhevm-engine/host-listener/src/database/ingest.rs

  491         );
  492 
  493         assert!(
  494             slow.is_empty(),
! 495             "no chain should be slow at exactly the threshold"
  496         );
  497     }
  498 
  499     // Single chain with exactly max_per_chain ops is not slow.

  509             max,
  510         );
  511         assert!(
  512             at_boundary.is_empty(),
! 513             "exactly at threshold should be fast"
  514         );
  515 
  516         let over_boundary = classify_slow_by_split_dependency_closure(
  517             &chains,

  519             max,
  520         );
  521         assert!(
  522             over_boundary.contains(&chains[0].hash),
! 523             "one over threshold should be slow"
  524         );
  525     }
  526 
  527     // Non linear: A -> B, A -> C, B -> D, C -> D

  539 
  540         assert!(slow.contains(&chains[0].hash), "A should be slow");
  541         assert!(
  542             slow.contains(&chains[1].hash),
! 543             "B should be slow (depends on A)"
  544         );
  545         assert!(
  546             slow.contains(&chains[2].hash),
! 547             "C should be slow (depends on A)"
  548         );
  549         assert!(
  550             slow.contains(&chains[3].hash),
! 551             "D should be slow (depends on B and C)"
  552         );
  553     }
  554 }

@mergify
Copy link
Copy Markdown

mergify bot commented Mar 16, 2026

🧪 CI Insights

Here's what we observed from your CI run for 4f4add6.

🟢 All jobs passed!

But CI Insights is watching 👀

@PanGan21 PanGan21 force-pushed the panos/improve-host-listener-test-coverage branch from 388c3ab to f49b9c5 Compare March 24, 2026 09:04
Copy link
Copy Markdown
Contributor

@Eikix Eikix left a comment

Choose a reason for hiding this comment

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

lgtm

@PanGan21
Copy link
Copy Markdown
Contributor Author

@mergify queue

@mergify
Copy link
Copy Markdown

mergify bot commented Mar 25, 2026

Merge Queue Status

This pull request spent 14 hours 49 minutes 28 seconds in the queue, including 13 hours 48 minutes 53 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
  • check-success = run-e2e-tests / fhevm-e2e-test
  • any of [🛡 GitHub branch protection]:
    • check-success = common-pull-request/lint (bpr)
    • check-neutral = common-pull-request/lint (bpr)
    • check-skipped = common-pull-request/lint (bpr)
  • any of [🛡 GitHub branch protection]:
    • check-success = coprocessor-cargo-test/cargo-tests (bpr)
    • check-neutral = coprocessor-cargo-test/cargo-tests (bpr)
    • check-skipped = coprocessor-cargo-test/cargo-tests (bpr)
  • any of [🛡 GitHub branch protection]:
    • check-success = coprocessor-dependency-analysis/dependencies-check (bpr)
    • check-neutral = coprocessor-dependency-analysis/dependencies-check (bpr)
    • check-skipped = coprocessor-dependency-analysis/dependencies-check (bpr)
  • any of [🛡 GitHub branch protection]:
    • check-skipped = gateway-contracts-deployment-tests/sc-deploy (bpr)
    • check-neutral = gateway-contracts-deployment-tests/sc-deploy (bpr)
    • check-success = gateway-contracts-deployment-tests/sc-deploy (bpr)
  • any of [🛡 GitHub branch protection]:
    • check-skipped = kms-connector-tests/test-connector (bpr)
    • check-neutral = kms-connector-tests/test-connector (bpr)
    • check-success = kms-connector-tests/test-connector (bpr)

@mergify mergify bot added the queued label Mar 25, 2026
mergify bot added a commit that referenced this pull request Mar 25, 2026
mergify bot added a commit that referenced this pull request Mar 25, 2026
@mergify mergify bot merged commit 04bd48a into main Mar 26, 2026
63 of 64 checks passed
@mergify mergify bot deleted the panos/improve-host-listener-test-coverage branch March 26, 2026 00:37
@mergify mergify bot removed the queued label Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants