Skip to content

Add regression test for VoteParty votes accumulated during preparation - #1755

Draft
BenCodez wants to merge 1 commit into
fix/voteparty-shared-recipient-enumerationfrom
test/voteparty-pending-preparation-recheck
Draft

BenCodez wants to merge 1 commit into
fix/voteparty-shared-recipient-enumerationfrom
test/voteparty-pending-preparation-recheck

Conversation

@BenCodez

@BenCodez BenCodez commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Purpose

Add a deterministic regression test for the pending VoteParty recheck identified during review of #1750.

The test starts a shared-MySQL VoteParty at a threshold of 3, leaves stored-recipient preparation pending, then records three additional votes and their normal party checks before allowing the first party to complete.

The required behavior is that the remaining three votes retain progress ownership and trigger a second party without requiring a seventh vote.

Scope

Test-only change:

Expected result

The original pending-recheck failure is already addressed in published #1750 head 06cb888b2be2c64cbacb1cc7e220b6bfd81d7bde. That commit contains this named regression with additional personal-eligibility assertions; its recorded focused validation passed. This PR remains a separate test-only change on its existing stacked branch; its older base snapshot does not establish a failure in current #1750. The required passing behavior remains:

  • 6 accumulated votes -> 2 parties
  • final global VoteParty count = 0
  • two party metadata commits
  • no additional/seventh vote needed

Base

This PR intentionally targets fix/voteparty-shared-recipient-enumeration (PR #1750's branch), not master, because the regression exercises the new stored-preparation code introduced by #1750.

Summary by CodeRabbit

  • Tests
    • Added coverage for vote-party thresholds while stored-recipient preparation is pending. The test verifies that additional votes are retained during preparation, then rechecked when queued work completes, resetting the vote total and recording the expected party updates.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Adds a test that verifies votes accumulated during stored-recipient preparation are rechecked when queued work completes. The test checks the vote total and the number of vote-party updates.

Changes: Stored-recipient vote handling

Layer / File(s) Summary
Preparation recheck test
VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/specialrewards/VotePartyStoredRecipientFailureTest.java
The test verifies that votes received during preparation do not start another party immediately. After queued work completes, it checks that the accumulated votes trigger a second party update and reset the total to zero.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Merge Risk: Minimal · up to a2cd2

This PR only adds a test for VoteParty votes accumulated during stored-recipient preparation, so it does not change production behavior. It is expected to fail until the underlying recheck fix lands, which matters only for merge ordering.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: a new regression test covering VoteParty votes accumulated while stored-recipient preparation is pending. The raw summary confirms the change is a single test-only addition…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the change: a new regression test covering VoteParty votes accumulated while stored-recipient preparation is pending. The raw summary confirms the change is a single test-only addition that checks those votes trigger the next party, and the objectives describe the same test. The title is specific and matches the changeset, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 97420ca2-86fd-4a96-83f4-53c2de781bf8
Commits

Reviewing files that changed from the base of the PR and between 23e346c and a2cd253.

Files selected for processing: 1

  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/specialrewards/VotePartyStoredRecipientFailureTest.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Recent review details

Additional context used

Code guidelines: 1

AGENTS.md — auto-discovered
Path-based instructions: 1

Source excerpt: All project tests and test-only helpers belong under `VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/`, with package `com.bencodez.votingplugin.tests` or a meaningful subpackage.

CodeRabbit inference engine (AGENTS.md)

Files:

  • VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/specialrewards/VotePartyStoredRecipientFailureTest.java
Learnings: 1

Common learnings

Learnt from: CR
Repo: BenCodez/VotingPlugin

Timestamp: 2026-11-14T16:24:40.409Z
Learning: Source excerpt:
# Maintainer and AI-agent guide

## Build and verification

All project tests and test-only helpers belong under `VotingPlugin/src/test/java/com/bencodez/votingplugin/tests/`, with package `com.bencodez.votingplugin.tests` or a meaningful subpackage. Keep paths and package declarations aligned, and update cross-test imports, resources, and build selectors when moving tests. Preserve package-phase artifact checks and test discovery. Do not widen production APIs to make tests accessible; use narrowly scoped test-only reflection for non-public seams. Platform API fixtures that must retain an external runtime class identity (such as `net.minecraft.network.chat.Component`) stay in that platform package and must not contain test cases.
Learnt from: CR
Repo: BenCodez/VotingPlugin

Timestamp: 2026-11-14T16:23:51.852Z
Learning: Source excerpt:
# VotingPlugin code review

## 3. Trace changed behavior and its contracts

### Security, packaging, and test evidence

- Tests should detect the claimed regression and assert observable behavior, not
  just mocks. Inspect negative/recovery/concurrency cases when central. Missing
  tests alone are not a finding; demonstrate broken behavior or a defective test
  contract. Passing tests do not substitute for tracing behavior.
Learnt from: CR
Repo: BenCodez/VotingPlugin

Timestamp: 2026-11-14T16:23:51.852Z
Learning: Source excerpt:
# VotingPlugin code review

## 3. Trace changed behavior and its contracts

### VotingPlugin voting and network behavior

- Check name/UUID identity, site normalization, per-site/global totals, streaks,
  milestones, vote-party progress, and top-voter/reset logic when touched. Test
  time-zone/day/month boundaries, restart, concurrent votes, and storage failures
  against configured semantics rather than assuming a single time zone.

BenCodez added a commit that referenced this pull request Nov 16, 2026
…covery

Retain pending checks with attempt and reset-generation fences, provide a
storage-worker fallback for rejected rechecks, and retry counter cleanup
without repeating rewards. Preserve votes arriving after the party boundary
and exclude those votes from the preceding party's eligibility.

Restore pre-dispatch state after commit or broadcast failure, retain failed
restoration for subsequent recovery, enforce current enabled/period limits,
and report force requests rejected while another party is pending.

Includes the accumulated-vote regression from a2cd253
(PR #1755), together with recovery, ordering and scheduler regressions.

This branch has not been deployed

No deployments
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.

1 participant