fix(elixir): make mix test self-contained + repair KRaft membership semantics#125
Merged
Merged
Conversation
…emantics
elixir-ci has been red on main since 2026-06-01 (90/634 failures). Root
causes and fixes:
- test_helper.exs never excluded :integration, so 80 federation-adapter
integration tests (live MongoDB/Redis/Neo4j/ClickHouse/SurrealDB/
InfluxDB/MinIO required) ran — and failed — in CI. ExUnit now starts
with exclude: [:integration]; run them via mix test --include
integration (the convention CLAUDE.md already documents).
- vql_e2e_test.exs: 8 failures from one missing alias — VQLBridge was
absent from the alias list, so 8 call sites hit a nonexistent bare
module. (These tests are designed to pass without the Rust core; they
are unit tests, not integration.)
- kraft_supervisor_test.exs: stale assertion — Registry.child_spec/1
uses the :name option as child id (VeriSim.Consensus.Registry), not
Registry.
- kraft_node.ex: two real consensus fixes.
(1) Latest-config-in-log rule (Ongaro §4.1): quorum counting and
replication targets now use effective_peers/1 — the applied peer
set plus unapplied membership deltas in the log suffix. Previously
remove_server could never commit in a 2-node cluster with an
unresponsive peer (proposal counted against the old config) and
timed out; stale peers' match_index also leaked into quorum
counting via Map.values.
(2) Peer RPC tasks caught exceptions but not exits: GenServer.call to
a dead/unregistered peer exits (:noproc), crashing the task. Both
RPC tasks now treat that as a failed RPC (heartbeat/election timer
drives the retry), which is the correct Raft posture.
- kraft_node_test.exs: membership tests now spawn a real follower
process instead of a phantom peer name — under the faithful rule the
add entry itself commits against the NEW configuration, so a server
that never responds correctly cannot be added. Added wait_for_leader/2
polling instead of fixed sleeps for leadership.
- coveralls.json: skip lib/verisim/federation/adapters/ from the unit
coverage denominator (they are exercised by the excluded :integration
suite); CI job renamed to match reality (the old name claimed a 60%
gate; the config gate is 40%).
Verification here: all touched files parse (Code.string_to_quoted!) and
mix format --check-formatted passes. Full compile + suite verification
happens in CI — the network policy of this environment blocks
repo.hex.pm, so mix deps.get cannot run locally (documented constraint).
https://claude.ai/code/session_01E8BpV19yxhf67UrCrvkfTr
🔍 Hypatia Security ScanFindings: 177 issues detected
View findings[
{
"reason": "Issue in build-validation.yml",
"type": "missing_timeout_minutes",
"file": "build-validation.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in build-validation.yml",
"type": "missing_timeout_minutes",
"file": "build-validation.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in cflite_batch.yml",
"type": "missing_timeout_minutes",
"file": "cflite_batch.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in cflite_pr.yml",
"type": "missing_timeout_minutes",
"file": "cflite_pr.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in codeql.yml",
"type": "missing_timeout_minutes",
"file": "codeql.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in coq-build.yml",
"type": "missing_timeout_minutes",
"file": "coq-build.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dogfood-gate.yml",
"type": "missing_timeout_minutes",
"file": "dogfood-gate.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in elixir-ci.yml",
"type": "missing_timeout_minutes",
"file": "elixir-ci.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in elixir-ci.yml",
"type": "missing_timeout_minutes",
"file": "elixir-ci.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in elixir-ci.yml",
"type": "missing_timeout_minutes",
"file": "elixir-ci.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
hyperpolymath
marked this pull request as ready for review
June 11, 2026 22:59
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.
Repairs the Elixir suite that has kept
elixir-cired on main since 2026-06-01 (90/634 failures), surfaced when #122 touched the workflow file and re-triggered the path-filtered jobs.Root causes fixed:
test_helper.exsnever excluded:integration→ 80 federation-adapter integration tests (which require live MongoDB/Redis/Neo4j/ClickHouse/SurrealDB/InfluxDB/MinIO) ran and failed in CI. ExUnit now starts withexclude: [:integration], matching the documented convention (mix test --include integrationruns them against the test-infra stack).vql_e2e_test.exs: all 8 failures were one missing alias (VQLBridgeabsent from the alias braces → bare-moduleUndefinedFunctionError). These tests are designed to pass without the Rust core, so they stay in the unit suite.kraft_supervisor_test.exs: stale assertion —Registry.child_spec/1uses the:nameoption as the child id.kraft_node.ex, two real consensus fixes:effective_peers/1(applied peers + unapplied membership deltas in the log suffix). Previouslyremove_serverdeadlocked against the old configuration when a peer was unresponsive, and stale peers'match_indexleaked into quorum counting.rescuedoesn't catch:exit— calls to dead/unregistered peers crashed the RPC tasks. Now treated as failed RPCs (heartbeat/election timer retries), the correct Raft posture.kraft_node_test.exs: membership tests spawn a real follower instead of a phantom peer (under the faithful rule, a server that never responds correctly cannot be added), with leadership polling instead of fixed sleeps.Verification: all touched files parse-checked and
mix format --check-formattedpasses locally; full compile + suite runs in CI (this environment's network policy blocks repo.hex.pm, somix deps.getcan't run here — stated plainly rather than simulated).https://claude.ai/code/session_01E8BpV19yxhf67UrCrvkfTr
Generated by Claude Code