Skip to content

Conversation

@chilagrow
Copy link
Contributor

@chilagrow chilagrow commented Jul 10, 2025

Description

Add test ambiguous logic for startSession creating two sessions. Unfortunately this test only runs on proxy for now.

Closes #5309.

Readiness checklist

  • I added/updated unit tests (and they pass).
  • I added/updated integration/compatibility tests (and they pass).
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Milestone (Next), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@chilagrow chilagrow self-assigned this Jul 10, 2025
@chilagrow chilagrow added the code/chore Code maintenance improvements label Jul 10, 2025
@chilagrow chilagrow added this to the Next milestone Jul 10, 2025
@codecov
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.78%. Comparing base (cff1577) to head (4afc74e).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5333      +/-   ##
==========================================
- Coverage   42.79%   42.78%   -0.02%     
==========================================
  Files         172      172              
  Lines       18427    18427              
==========================================
- Hits         7886     7884       -2     
- Misses      10111    10113       +2     
  Partials      430      430              

see 4 files with indirect coverage changes

Flag Coverage Δ
integration 46.04% <ø> (+<0.01%) ⬆️
mongodb 9.27% <ø> (ø)
mongodb-1 9.27% <ø> (ø)
postgresql 45.20% <ø> (-0.07%) ⬇️
postgresql-1 35.50% <ø> (-0.51%) ⬇️
postgresql-2 35.74% <ø> (+0.37%) ⬆️
postgresql-3 36.43% <ø> (-0.19%) ⬇️
postgresql-4 35.70% <ø> (+<0.01%) ⬆️
postgresql-5 35.26% <ø> (-0.02%) ⬇️
unit 13.10% <ø> (ø)
yugabytedb 42.25% <ø> (+<0.01%) ⬆️
yugabytedb-1 32.06% <ø> (-0.46%) ⬇️
yugabytedb-2 32.54% <ø> (+0.53%) ⬆️
yugabytedb-3 34.28% <ø> (+0.25%) ⬆️
yugabytedb-4 32.23% <ø> (+0.20%) ⬆️
yugabytedb-5 32.68% <ø> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
clientconn 57.93% <ø> (ø)
dataapi 6.61% <ø> (ø)
documentdb 15.29% <ø> (+0.07%) ⬆️
handler 76.47% <ø> (-0.15%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chilagrow chilagrow marked this pull request as ready for review July 10, 2025 08:27
Copilot AI review requested due to automatic review settings July 10, 2025 08:27
@chilagrow chilagrow requested a review from AlekSi as a code owner July 10, 2025 08:27
@chilagrow chilagrow requested review from a team and noisersup July 10, 2025 08:27
@chilagrow chilagrow enabled auto-merge (squash) July 10, 2025 08:27

This comment was marked as outdated.

@chilagrow chilagrow requested a review from Copilot July 11, 2025 02:19

This comment was marked as outdated.

@AlekSi AlekSi modified the milestones: v2.4.0, Next Jul 15, 2025
@chilagrow chilagrow requested a review from Copilot July 16, 2025 07:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a test to verify that calling startSession with an lsid parameter creates two distinct sessions in the system. The test validates the ambiguous logic behavior where both the provided lsid and a new session ID are created and stored.

  • Adds TestStartSessionWithLSIDCreatesTwoSessions function to test session creation behavior
  • Integrates with $listLocalSessions aggregation to verify both session IDs exist
  • Uses wire protocol directly for startSession and driver for session listing
Comments suppressed due to low confidence (2)

integration/session/startsession_test.go:559

  • [nitpick] The variable name containsLsidF is unclear. Consider renaming to containsLsid or lsidFound for better readability.
		containsLsidF := slices.ContainsFunc(sessionIDs, func(id wirebson.Binary) bool { return wirebson.Equal(lsid, id) })

integration/session/startsession_test.go:562

  • [nitpick] The variable name containsSessionIDF is unclear. Consider renaming to containsSessionID or sessionIDFound for better readability.
		containsSessionIDF := slices.ContainsFunc(sessionIDs, func(id wirebson.Binary) bool { return wirebson.Equal(sessionID, id) })

noisersup
noisersup previously approved these changes Jul 17, 2025
@AlekSi AlekSi modified the milestones: v2.5.0, Next Aug 11, 2025
# Conflicts:
#	integration/session/startsession_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code/chore Code maintenance improvements

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Figure out MCP and Data API authentication

3 participants