Skip to content

[tests-only][full-ci] test(cli): add acceptance tests for the search optimize command - #12741

Open
anon-pradip wants to merge 3 commits into
owncloud:masterfrom
anon-pradip:test/search-optimize-cli
Open

[tests-only][full-ci] test(cli): add acceptance tests for the search optimize command#12741
anon-pradip wants to merge 3 commits into
owncloud:masterfrom
anon-pradip:test/search-optimize-cli

Conversation

@anon-pradip

@anon-pradip anon-pradip commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

Adds acceptance tests for the new ocis search optimize CLI command (#12136), which compacts the Bleve search index without re-indexing content.

What's included

  • New feature file tests/acceptance/features/cliCommands/searchOptimize.feature with two scenarios:
    • optimize the search index: covers the full contract: clean index -> reindex -> baseline search (207) -> stop server -> optimize -> start server -> file still searchable with exact expected results. The baseline search before optimizing isolates failures (reindex problem vs optimize problem).
    • optimize the search index without any indexed content: verifies the command succeeds and prints index optimization complete on an empty index. No reindex and no search assertions, because optimize compacts segments, it does not index content.
  • Reliability fix: searchWithRetry in SearchContext.php is now two-phase. It polls until the search service answers HTTP 207 after a restart (~63s budget), then polls for results (~13s). This removes the flaky fixed-sleep pattern that failed after server restarts while keeping the old fast path for scenarios that never restart anything.
  • New config constant SERVICE_READY_RETRY_COUNT in bootstrap.php.

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@kw-security

kw-security commented Aug 6, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@anon-pradip
anon-pradip force-pushed the test/search-optimize-cli branch from d5b76f9 to a3c7967 Compare August 6, 2026 12:29
@ishabaral ishabaral mentioned this pull request Aug 7, 2026
16 tasks
@anon-pradip
anon-pradip force-pushed the test/search-optimize-cli branch 3 times, most recently from 5e28b35 to 8148a64 Compare August 7, 2026 11:09
@anon-pradip
anon-pradip force-pushed the test/search-optimize-cli branch from 8148a64 to d2ad05c Compare August 26, 2026 07:07
@anon-pradip
anon-pradip marked this pull request as ready for review August 26, 2026 09:13
@anon-pradip
anon-pradip requested a review from a team as a code owner August 26, 2026 09:13
Comment thread tests/acceptance/features/cliCommands/searchOptimize.feature Outdated
@anon-pradip
anon-pradip force-pushed the test/search-optimize-cli branch from e52e0cc to 681c00a Compare August 27, 2026 08:34
@anon-pradip
anon-pradip force-pushed the test/search-optimize-cli branch from 681c00a to ae88ccd Compare August 27, 2026 11:11
@anon-pradip
anon-pradip force-pushed the test/search-optimize-cli branch from ae88ccd to e740cd3 Compare August 31, 2026 04:26
Given user "Alice" has been created with default attributes
And using spaces DAV path
And user "Alice" has uploaded file with content "some data" to "textfile.txt"
And the administrator reindexes all spaces using the CLI

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
And the administrator reindexes all spaces using the CLI
When the administrator reindexes all spaces using the CLI

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