Add JCStress tests for message queue clearing before nextQueued()#1140
Draft
Add JCStress tests for message queue clearing before nextQueued()#1140
Conversation
Co-authored-by: chrjohn <[email protected]>
Co-authored-by: chrjohn <[email protected]>
Co-authored-by: chrjohn <[email protected]>
Co-authored-by: chrjohn <[email protected]>
Co-authored-by: chrjohn <[email protected]>
Co-authored-by: chrjohn <[email protected]>
Co-authored-by: chrjohn <[email protected]>
Copilot
AI
changed the title
[WIP] Add stress test for clearing messages from queue
Add JCStress tests for message queue clearing before nextQueued()
Feb 15, 2026
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.
Adds stress tests validating that messages cleared via SequenceReset-GapFill are not subsequently processed by
nextQueued(). Related to PR #1133's queue clearing behavior.Implementation
Two JCStress test classes (332 configurations total):
ClearBeforeNextQueuedTest: Tests execution ordering betweenprocessNextQueued()anddequeueMessagesUpTo(). Validates that messages are either cleared OR processed, never both.MultipleSequenceResetTest: Tests multiple concurrentdequeueMessagesUpTo()calls with different sequence numbers to verify queue consistency.Design notes:
InMemoryMessageQueue's single-threaded contract ("The map should be accessed from a single thread")MIN_SEQ_NUM=5,MAX_SEQ_NUM=9,CLEAR_ALL_SEQ_NUM=10)Test validation
Pre-populates queue with 5 messages (seqnum 5-9). Actor orderings tested:
0 processed, 0 queued1-5 processed, 0 queuedN processed, 0 queuedwhere N < 5All outcomes verify queue is empty post-execution with no messages lost or double-processed.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.