Skip to content

test(logservice): establish heartbeat fixture readiness - #29173

Merged
XuPeng-SH merged 1 commit into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-28923
Sep 20, 2026
Merged

XuPeng-SH merged 1 commit into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-28923

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Test and CI

Which issue(s) this PR fixes:

Related to #28923. This corrects the heartbeat test's fixture contract; it does not establish the cause of the historical 0.68-second failure or fix a production timeout defect.

What this PR does / why we need it:

TestAddHeartbeat started HAKeeper asynchronously and used one shared one-second context for four heartbeat operations. Make the intended test boundary explicit:

  • Require successful startup and bounded leader discovery followed by a successful linearizable state read.
  • Submit each heartbeat once with its own one-second context, cancelling it immediately afterward.
  • Read the applied state and verify log addresses/incarnation/replicas, CN address/work state, TN shards, and proxy identity/listen address.
  • Compare replica protobuf values semantically, preserving equality across empty-map normalization.

No production code, shared fixture, timeout defaults, sleeps, or heartbeat retry loops change. Existing readiness cancellation/missing-shard/closed-host/no-quorum controls remain intact.

The exact pinned Dragonboat source was inspected separately. RTT quantization loses less than 10 ms; it does not explain the reported duration. An external deterministic diagnostic demonstrates premature logical expiration when a new shard admits a proposal before synchronizing its zero-origin clock with absolute host ticks, but this does not reconstruct the historical CI schedule. This PR does not mask or claim to repair that dependency behavior.

Validation (Go1.26.4/macOS arm64, verified native artifacts, -p 2):

  • Changed test and existing readiness controls passed.
  • Full pkg/logservice package passed (110.345s).
  • 100 focused race iterations passed (47.196s), selected from a measured0.17s single run.
  • gofmt/diff checks, owning-package vet, and incremental lint passed.
  • Separate GPT-6 medium design and overall review passed; all delivery conditions are satisfied.

Historical Ubuntu/amd64 reproduction remains unavailable. CI is pending; no CI wait performed.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PASS — reviewed exact head 1f19967 against base bc523de.

Read all changed hunks and traced readiness, proposal/application, the linearizable checker read, and fixture teardown. Readiness is established before the four independently bounded heartbeat calls; assertions verify applied payloads rather than only successful returns. Context and store cleanup remain effective on FailNow.

Reused completed focused/readiness, race-100 and owning-package evidence; exact-head CI is successful. This validates the fixture contract, not a proven historical timeout root cause or a production fix.

No P0/P1/P2 blockers found. Coverage was not used as a gate.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants