Skip to content

test(changes follower): cover zero limit edge case - #5

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1787151042-changes-follower-limit-zero-test
Open

test(changes follower): cover zero limit edge case#5
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1787151042-changes-follower-limit-zero-test

Conversation

@devin-ai-integration

Copy link
Copy Markdown

PR summary

Adds test_limit_zero to both TestChangesFollowerFinite and TestChangesFollowerListen, covering the boundary of the existing limits fixture (100, _BATCH_SIZE, _BATCH_SIZE + 123) which never exercises limit=0.

With limit=0 the follower takes a distinct path: _run clamps batch_size to 0 and _ChangesFollowerIterator.__next__ short-circuits on limit == 0 before consuming the buffer, so the iterator must stop cleanly (including joining the request thread) with zero changes even though the mocked feed has MAX_BATCHES available. In LISTEN mode this is the only condition under which the feed terminates on its own without stop() or an error.

Both tests use the shared runner with a generous timeout, so a regression that hangs (e.g. blocking on Queue.get) or emits changes fails the assertion rather than passing vacuously.

Fixes: n/a — test-only addition.

PR Checklist

Please make sure that your PR fulfills the following requirements:

  • The commit message follows the
    Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • New tests
  • Build/CI related changes
  • Documentation content changes
  • Other (please describe)

What is the current behavior?

limit=0 is untested in both operating modes.

What is the new behavior?

No production code changes; the zero-limit behaviour is now asserted for FINITE and LISTEN modes.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

python -m pytest test/unit/features/test_changes_follower.py (41 passed) and python -m pylint --rcfile=.pylintrc ibmcloudant (10.00/10) pass locally.

Link to Devin session: https://app.devin.ai/sessions/a8f6ece030764ec194d962c4552b83cf
Requested by: @eml2026

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@laveresteban laveresteban self-assigned this Aug 19, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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