Skip to content

Conversation

@torcolvin
Copy link
Collaborator

@torcolvin torcolvin commented Nov 19, 2025

  • the problem seems to be that some tests take a long time to run, mostly after churn of the bucket pool to do query operations after resync finishes
  • clean up to use test functions for waiting

Integration Tests

- the problem seems to be that some tests take a long time to run,
mostly after churn of the bucket pool to do query operations after resync finishes
- clean up to use test functions for waiting
Copilot AI review requested due to automatic review settings November 19, 2025 22:11
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 addresses test flakiness in ResyncManager tests by improving wait conditions and error handling. The main issue was that some tests were timing out due to slow query operations, particularly in CI environments with GSI disabled (using views instead).

  • Replaced custom wait loops with standard test helper functions for consistency
  • Extended wait times for non-Walrus tests to account for slower query operations
  • Improved error handling in invalidateAllPrincipals function

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
db/util_testing.go Extended RequireBackgroundManagerState timeout and added context handling
db/background_mgr_resync_dcp_test.go Refactored tests to use helper functions and removed redundant ResyncManager initialization
db/background_mgr_resync_dcp.go Added error handling for principal invalidation
db/database.go Changed invalidateAllPrincipals to return error instead of ignoring it
db/database_collection.go Removed unused invalidateAllPrincipals wrapper method
db/database_test.go Updated test to use database-level method and check error
rest/attachmentmigrationtest/attachment_migration_test.go Removed unnecessary context parameter from helper call
db/background_mgr_attachment_migration_test.go Removed unnecessary context parameter from helper calls

@torcolvin torcolvin requested a review from gregns1 November 20, 2025 14:41
waitTime := 10 * time.Second
if !base.UnitTestUrlIsWalrus() {
// Increase wait time for CI tests against Couchbase Server with GSI disabled (views), some queries take a
// longer time to run
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be an additional check here for gsi being enabled given the comment suggests this is views specific?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the comment is wrong actually. It takes longer for views, but it just sometimes also takes a long time for Couchbase Server if I've angered overloaded it. I decided not to investigate a lot because I already did a boring and unfruitful views investigation before I realised I didn't use SG_TEST_USE_GSI=true. I think the benefits of waiting longer outweigh potentially not returning early.

@torcolvin torcolvin requested a review from gregns1 November 21, 2025 14:38
@torcolvin torcolvin requested a review from Copilot November 24, 2025 14:09
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

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

@torcolvin torcolvin assigned torcolvin and unassigned gregns1 Nov 24, 2025
@torcolvin torcolvin assigned gregns1 and unassigned torcolvin Nov 24, 2025
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.

3 participants