Skip to content

Fix iteration tests: add handlers, responses, and requests#291

Closed
p123-stack wants to merge 53 commits intomainfrom
stub/iteration
Closed

Fix iteration tests: add handlers, responses, and requests#291
p123-stack wants to merge 53 commits intomainfrom
stub/iteration

Conversation

@p123-stack
Copy link
Copy Markdown
Collaborator

Add handlers, request, and response classes for the testkit backend so iteration tests pass and match the expected driver behavior.

Handlers and classes:

  • ResultList – Iterates over results and returns RecordListResponse; uses a while loop instead of foreach so it continues from the current position when next() was called first.
  • ResultSingle – Returns exactly one record or a DriverError when the count is not 1; registered in RequestFactory.
  • ResultSingleOptional – Returns one record or null when there are 0 or more than 1; uses a while loop to avoid rewind on already-consumed results.
  • ResultPeek – Returns the next record without advancing the iterator.
  • ResultNext – Advances the iterator after returning the current record so next() and list() share the same position.

Expected driver behavior:

  • result.next() advances the iterator; result.list() continues from the current position and does not rewind.
  • result.single() consumes the result and enforces exactly one record.
  • result.single_optional() consumes the result and returns one record or null.
  • result.peek() returns the next record without consuming it.

Resolves ConnectionTimeoutException in CI when queries exceed 5 seconds.
Rethrow connection errors instead of converting to NotALeader. Retry logic
now uses isConnectionError() with extended message checks. Also fixes merge
artifacts in BoltResult and AbstractRunner.
Made-with: Cursor

# Conflicts:
#	src/Bolt/BoltConnection.php
#	src/Bolt/BoltResult.php
#	src/Bolt/Connection.php
#	src/Bolt/Session.php
#	src/Bolt/StreamConnectionFactory.php
#	src/Contracts/BoltMessage.php
#	src/Formatter/SummarizedResultFormatter.php
#	testkit-backend/src/Handlers/AbstractRunner.php
#	testkit-backend/src/Handlers/ResultNext.php
#	testkit-backend/src/Handlers/RetryableNegative.php
#	testkit-backend/testkit.sh
@p123-stack p123-stack changed the base branch from stub/disconnects to main March 30, 2026 12:53
Bring branch up to date with main (failover, TypeCaster, transaction fixes).
Resolve conflicts by taking main for core Bolt/BoltFactory/testkit handlers;
keep stub iteration test list in testkit-backend/testkit.sh.

Made-with: Cursor
@transistive transistive closed this Apr 8, 2026
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.

2 participants