test: Serialize search tests, cap index waits, skip internal CI package - #4740
EspenAlbert wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
internal/testutil/acc/atlas.go does not compile, and its cluster-tier override expands the stated PR scope.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates search acceptance tests to reduce contention, bound long-running operations, skip internal API tests in CI, and improve sample-load diagnostics.
Changes:
- Serializes search acceptance tests and adds 60-minute operation timeouts.
- Skips
searchindexapitests in CI. - Extends sample-data polling and reports failure details.
- Adds configurable test cluster tiers.
File summaries
| File | Summary |
|---|---|
internal/testutil/acc/cluster.go |
Adds configurable cluster-tier selection. |
internal/testutil/acc/cluster_test.go |
Tests cluster-tier resolution. |
internal/testutil/acc/cloud_backup_collection_restore_fixture_test.go |
Updates sample-load failure tests. |
internal/testutil/acc/atlas.go |
Applies the configured cluster tier. |
internal/testutil/acc/advanced_cluster.go |
Improves sample-data polling and error reporting. |
internal/serviceapi/searchindexapi/resource_test.go |
Serializes, skips CI execution, and adds timeouts. |
internal/service/searchindex/resource_search_index_test.go |
Serializes legacy tests, adds timeouts, and covers wait behavior. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🤖 Augment PR SummarySummary: This PR reduces search-index acceptance-test flakiness and excessive CI runtime caused by queued index builds on a shared execution cluster. Changes:
Technical Notes: The timeout blocks only affect acceptance-test configurations; provider defaults are unchanged. The API resource's existing multi-hour READY/STEADY waits are bounded in local test configurations and avoided in routine CI. 🤖 Was this summary useful? React with 👍 or 👎 |
Why
Both search packages fail often against cloud-dev. The two packages share one three-node
M10execution cluster and every test runs in parallel, so index builds queue.searchindexapimakes it worse: its generated resource waits three hours forREADY, STEADYper operation, unconditionally, which holds a job and can cross the 300 minute test deadline. That wait is what makes this a cost change and not only a flake fix.The same wait is opt-in in the legacy
searchindexresource behindwait_for_index_build_completion, and no test in that package ever set it, so neither its create nor its update wait had run.What
Follows the search-test 1-pager, which carries the measurements and the rejected alternatives: One Pager: Search acceptance test fixes and WRITING-40266.
This PR carries all four test-side changes from the 1-pager.
searchindexapiin CI.acc.SkipTestForCI(t)is the first statement in all 9 tests of the package, above theacc.ClusterNameExecutioncall. The package stays in theautogen_slowACCTEST_PACKAGESlist, so it still runs locally and on demand and still detects upstream schema changes. Its 3 hour wait holds the job for hours, and the resource is internal: not registered in the provider, no customer docs page.searchindexand all 9 insearchindexapimove fromresource.ParallelTesttoresource.Test. The other 2 legacy tests already ran serially. Each package runs in its own job, so each is serialized independently.TestAccSearchIndex_updatedToEmptyMappingsFieldsnow setswait_for_index_build_completionin both steps, so it is the first test to exercise the create and updateREADY, STEADYwaits in the legacy package. No new test.timeoutsblock with create, update, and delete at 60 minutes: 9 configs in each package. The tests inherit no timeout today and the resource default is 3 hours. The block caps one Terraform operation, so it does not bound the multi-step test total and does not change shipped defaults.FAILEDload now reports the job'serrorMessage, so the CI log names the cause instead of only the job ID and state. The fail-fast onFAILEDis unchanged.Type of change:
Required Checklist:
FollowUp/Next Steps
READY, STEADYmisread stays open. The 1-pager reads it as the provider missing a terminal state rather than the build never finishing, and skippingsearchindexapiremoves the only CI reproduction. Reinstating those tests is the way back to a signal.M10figure forsearchindexapion dev, so there is no full before-and-after for the serialization there. Five of nine tests have no cleanM10measurement.