Skip to content

Commit

Permalink
Production release v20230507.0 (#5549)
Browse files Browse the repository at this point in the history
* Exclude versioned Jetpacks from the `-built` version. (#5496)

* Don't delete jetpack-* recursively, do the root only. Supply --delete-excluded flag (#5498)

* CI: Preserve the .git folder when running --delete-excluded (#5500)

* Don't delete jetpack-* recursively, do the root only. Supply --delete-excluded flag

* Preserve .git

* Use full path

* Add debug to rsync output in Deploy workflow (#5501)

* Move backup one folder up to prevent the deletion during the rsync (#5502)

* Add debug to rsync output in Deploy workflow

* Move .git backup one level up

* Remove debug info from Deploy action (#5503)

* fix: `count_users()` returns an array (#5499)

* fix: `count_users()` returns an array

* test: fix tests

* CI: set minimum Parse.ly version to 3.5 (#5506)

* CI: update Parse.ly minimum version, fix some typos

* Remove debug-bar and debug-bar-cron as they're not the part of mu-plugins

* Add the ability to define a custom VIP integrations config directory (#5505)

* Search: Defaults Enterprise Search to ElasticPress 4.2.2 (#4607)

* Search: Remove exception list

* Search: Switch to new EP as default

* Sync changes down

* Update submodule change to latest one

* Update the PR template to include the new Changelog format (#5477)

* Remove limitation on "wp db size" (#5507)

* Revert "Remove limitation on "wp db size" (#5507)" (#5522)

This reverts commit 2efcab4.

Revert "Remove limitation on "wp db size" (#5507)"

This reverts commit 720c8b9.

* Search: Fix potential prolonged rate-limiting (#5524)

* Fix potential prolonged rate-limiting: the rate-limit start time object didn't have an expiration which may prevent the ratelimit window reset

* Fix context

* Apply settings on after_setup_theme to make sure customer code is included

* Only consider requests in current window when enabling ratelimiting

* Address feedback

* Apply SonarCloud suggestions

* remove ttl for indexing ratelimit start. More static over self.

---------

Co-authored-by: Rinat K <rinat@automattic.com>
Co-authored-by: Volodymyr Kolesnykov <volodymyr.kolesnykov@automattic.com>
Co-authored-by: Luis Henrique Mulinari <luis.henrique.mulinari@automattic.com>
Co-authored-by: Luiz Tiago Oliveira <luiztiago@gmail.com>
  • Loading branch information
5 people authored May 7, 2024
1 parent 5885371 commit 92eb440
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 109 deletions.
48 changes: 27 additions & 21 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,50 @@
:wave: Just a quick reminder that this is a public repo. Please don't include any internal links or sensitive data (like PII, private code, customer names, site URLs, etc. Any fixes related to security should be discussed with Platform before opening a PR. If you're not sure if something is safe to share, please just ask!
### BEFORE YOU PROCEED!!
If you’re editing a feature without changing the spirit of the implementation, fixing bugs, or performing upgrades, then please proceed!
If you’re adding a feature or changing the spirit of an existing implementation, please create a proposal in Cantina P2 using the MU Plugins Proposal Block Pattern. Please mention the [CODEOWNERS](.github/CODEOWNERS) of this repository and relevant stakeholders in your proposal :). Please be aware that any unplanned work may take some time to get reviewed. Thank you 🙇‍♀️🙇!
## For external contributors!
Welcome! We look forward to your contribution! ❤️
-->
## Description
<!--
A few sentences describing the overall goals of the Pull Request.
A few sentences providing more context and describing the overall goals of the Pull Request.
Should include any special considerations, decisions, and links to relevant GitHub issues.
Please don't include internal or private links :)
Should include any special considerations, decisions, and links to relevant publicly available sources (e.g. GitHub issues)
-->

## Changelog Description
<!--
A description of the context of the change for a changelog. It should have a title, examples (if applicable), and why the change was made.

**Please keep the changelog title format same as in example below (### <Title>), as this is later used to generate the changelog entry title.**
<!-- Changelogs are published for our customers. Well-written entries help them stay informed on platform changes and all of the great work that we do! -->

<!-- Write a concise description of changes in the relevant section.
- Add new line items as needed.
- Entries should follow the [Common Changelog Style Guide](https://github.com/vweevers/common-changelog).
- Remove all unused sections before merging.
- Proof-read.
-->

Example for a plugin upgrade:
### Added
- <!-- e.g. "Added a new set of filters for MFA status" -->
- <!-- e.g. "Dev-env: Added PHP 8.3 image" -->

### Plugin Updated: Jetpack 9.2.1
### Removed
- <!-- e.g. "Dropped support of Node.js 14" -->
-

### Fixed
- <!-- e.g. "Fixed a bug causing blank lines in content to be ignored when using the Regex Parser" -->

### Changed
- <!-- e.g. "Increased priority of wp_mail_from filter in VIP Dashboard to prevent unintentional overriding" -->
- <!-- e.g. "HyperDB: Updated to latest version to fix PHP error with addslashes()" -->

We upgraded Jetpack 9.2 to Jetpack 9.2.1.

Not a lot of significant changes in this patch release, just bugfixes and compatibility improvements.
-->
## Pre-review checklist

Please make sure the items below have been covered before requesting a review:

- [ ] This change works and has been tested locally (or has an appropriate fallback).
- [ ] This change works and has been tested on a Go sandbox.
- [ ] This change works and has been tested locally or in Codespaces (or has an appropriate fallback).
- [ ] This change works and has been tested on a sandbox.
- [ ] This change has relevant unit tests (if applicable).
- [ ] This change uses a rollout method to ease with deployment (if applicable - especially for large scale actions that require writes).
- [ ] This change has relevant documentation additions / updates (if applicable).
Expand All @@ -52,6 +57,7 @@ Please make sure the items below have been covered before requesting a review:
- [ ] VIP staff: Ensure any alerts added/updated conform to internal standards (see internal documentation).

## Steps to Test

<!--
Outline the steps to test and verify the PR here.
Expand All @@ -61,4 +67,4 @@ Example:
1. Go to `wp-admin` > `Tools` > `Bakery`
1. Click on "Bake Cookies" button.
1. Verify cookies are delicious.
-->
-->
4 changes: 2 additions & 2 deletions .github/actions/run-wp-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ runs:
run: |
if [ "${{ inputs.coverage }}" = "yes" ] && [ -n "${{ inputs.coverage-file }}" ]; then
echo "coverage=pcov" >> $GITHUB_OUTPUT
echo 'ini=apc.enable_cli=1, pcov.directory=., pcov.exclude="~/(vendor|tests|node_modules|jetpack[^/]*|wp-parsely[^/]+|advanced-post-cache|akismet|cron-control|debug-bar|debug-bar-cron|drop-ins|http-concat|lightweight-term-count-update|query-monitor|(search/(elasticpress|debug-bar-elasticpress|es-wp-query))|shared-plugins|rewrite-rules-inspector|vaultpress|wordpress-importer)/~"' >> $GITHUB_OUTPUT
echo 'ini=apc.enable_cli=1, pcov.directory=., pcov.exclude="~/(vendor|tests|node_modules|jetpack[^/]*|wp-parsely[^/]+|advanced-post-cache|akismet|cron-control|drop-ins|http-concat|lightweight-term-count-update|query-monitor|(search/(elasticpress|debug-bar-elasticpress|es-wp-query))|shared-plugins|rewrite-rules-inspector|vaultpress|wordpress-importer)/~"' >> $GITHUB_OUTPUT
else
echo "coverage=none" >> $GITHUB_OUTPUT
echo "ini=apc.enable_cli=1, opcache.enable_cli=1" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -89,7 +89,7 @@ runs:
run: echo "WP_MULTISITE=1" >> $GITHUB_ENV
if: inputs.multisite == 'yes'

- name: Disable JetPack
- name: Disable Jetpack
shell: bash
run: echo "VIP_JETPACK_SKIP_LOAD=1" >> $GITHUB_ENV
if: inputs.jetpack == 'no'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ jobs:

- name: Synchronize files
run: |
rsync --delete -a "${GITHUB_WORKSPACE}/${SOURCE_REPO_PATH}/" "${GITHUB_WORKSPACE}/${EXT_REPO_PATH}/"* "${GITHUB_WORKSPACE}/${TARGET_REPO_PATH}/" --exclude-from="${GITHUB_WORKSPACE}/${SOURCE_REPO_PATH}/.dockerignore" --exclude-from="${GITHUB_WORKSPACE}/${EXT_REPO_PATH}/.dockerignore"
mv "${GITHUB_WORKSPACE}/${TARGET_REPO_PATH}/.git" "${GITHUB_WORKSPACE}/${TARGET_REPO_PATH}/../built-git-bak"
rsync --delete --delete-excluded -a "${GITHUB_WORKSPACE}/${SOURCE_REPO_PATH}/" "${GITHUB_WORKSPACE}/${EXT_REPO_PATH}/"* "${GITHUB_WORKSPACE}/${TARGET_REPO_PATH}/" --exclude-from="${GITHUB_WORKSPACE}/${SOURCE_REPO_PATH}/.dockerignore" --exclude-from="${GITHUB_WORKSPACE}/${EXT_REPO_PATH}/.dockerignore" --exclude="/jetpack-*/"
mv "${GITHUB_WORKSPACE}/${TARGET_REPO_PATH}/../built-git-bak" "${GITHUB_WORKSPACE}/${TARGET_REPO_PATH}/.git"
- name: Clean up
run: |
TARGET="${GITHUB_WORKSPACE}/${TARGET_REPO_PATH}"
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/parsely.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ jobs:
matrix:
config:
# Oldest version of the parsely plugin
- { wp: latest, parsely: '3.1', mode: 'filter_enabled', php: '8.0' }
- { wp: latest, parsely: '3.1', mode: 'filter_disabled', php: '8.0' }
- { wp: latest, parsely: '3.1', mode: 'option_enabled', php: '8.0' }
- { wp: latest, parsely: '3.1', mode: 'option_disabled', php: '8.0' }
- { wp: latest, parsely: '3.1', mode: 'filter_and_option_enabled', php: '8.0' }
- { wp: latest, parsely: '3.1', mode: 'filter_and_option_disabled', php: '8.0' }
- { wp: latest, parsely: '3.5', mode: 'filter_enabled', php: '8.1' }
- { wp: latest, parsely: '3.5', mode: 'filter_disabled', php: '8.1' }
- { wp: latest, parsely: '3.5', mode: 'option_enabled', php: '8.1' }
- { wp: latest, parsely: '3.5', mode: 'option_disabled', php: '8.1' }
- { wp: latest, parsely: '3.5', mode: 'filter_and_option_enabled', php: '8.1' }
- { wp: latest, parsely: '3.5', mode: 'filter_and_option_disabled', php: '8.1' }

# Latest version of the parsely plugin
- { wp: latest, mode: 'filter_enabled', php: '8.0' }
- { wp: latest, mode: 'filter_disabled', php: '8.0' }
- { wp: latest, mode: 'option_enabled', php: '8.0' }
- { wp: latest, mode: 'option_disabled', php: '8.0' }
- { wp: latest, mode: 'filter_and_option_enabled', php: '8.0' }
- { wp: latest, mode: 'filter_and_option_disabled', php: '8.0' }
- { wp: latest, mode: 'filter_enabled', php: '8.1' }
- { wp: latest, mode: 'filter_disabled', php: '8.1' }
- { wp: latest, mode: 'option_enabled', php: '8.1' }
- { wp: latest, mode: 'option_disabled', php: '8.1' }
- { wp: latest, mode: 'filter_and_option_enabled', php: '8.1' }
- { wp: latest, mode: 'filter_and_option_disabled', php: '8.1' }
services:
mysql:
image: mysql:8
Expand Down
4 changes: 3 additions & 1 deletion integrations/integration-vip-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ private function set_config( string $slug ): void {
* @return null|mixed
*/
protected function get_vip_config_from_file( string $slug ) {
$config_file_directory = ABSPATH . 'config/integrations-config';
$config_file_directory = defined( 'WPVIP_INTEGRATIONS_CONFIG_DIR' )
? constant( 'WPVIP_INTEGRATIONS_CONFIG_DIR' )
: ABSPATH . 'config/integrations-config';
$config_file_name = $slug . '-config.php';
$config_file_path = $config_file_directory . '/' . $config_file_name;

Expand Down
2 changes: 1 addition & 1 deletion search/elasticpress
Submodule elasticpress updated 296 files
32 changes: 8 additions & 24 deletions search/includes/classes/class-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -1034,26 +1034,18 @@ public function get_index_settings_diff_for_indexable( \ElasticPress\Indexable $
$diff = [];

if ( $indexable->index_exists() ) {
if ( method_exists( '\Automattic\VIP\Search\Search', 'should_load_new_ep' ) && \Automattic\VIP\Search\Search::should_load_new_ep() ) {
$index_name = $indexable->get_index_name();
$settings = $this->elasticsearch->get_index_settings( $index_name );
$actual_settings = $settings[ $index_name ]['settings'] ?? [];
} else {
$actual_settings = $indexable->get_index_settings();
}
$index_name = $indexable->get_index_name();
$settings = $this->elasticsearch->get_index_settings( $index_name );
$actual_settings = $settings[ $index_name ]['settings'] ?? [];

if ( is_wp_error( $actual_settings ) ) {
$this->search->versioning->reset_current_version_number( $indexable );

return $actual_settings;
}

if ( method_exists( '\Automattic\VIP\Search\Search', 'should_load_new_ep' ) && \Automattic\VIP\Search\Search::should_load_new_ep() ) {
$mapping = $indexable->generate_mapping();
$desired_settings = $mapping['settings'];
} else {
$desired_settings = $indexable->build_settings();
}
$mapping = $indexable->generate_mapping();
$desired_settings = $mapping['settings'];

// We only monitor certain settings
$actual_settings_to_check = self::limit_index_settings_to_keys( $actual_settings, self::INDEX_SETTINGS_HEALTH_MONITORED_KEYS );
Expand Down Expand Up @@ -1118,12 +1110,8 @@ public function heal_index_settings_for_indexable( \ElasticPress\Indexable $inde
}
}

if ( method_exists( '\Automattic\VIP\Search\Search', 'should_load_new_ep' ) && \Automattic\VIP\Search\Search::should_load_new_ep() ) {
$mapping = $indexable->generate_mapping();
$desired_settings = $mapping['settings'];
} else {
$desired_settings = $indexable->build_settings();
}
$mapping = $indexable->generate_mapping();
$desired_settings = $mapping['settings'];

\Automattic\VIP\Logstash\log2logstash(
[
Expand All @@ -1141,11 +1129,7 @@ public function heal_index_settings_for_indexable( \ElasticPress\Indexable $inde
// Limit to only the settings that we auto-heal
$desired_settings_to_heal = self::limit_index_settings_to_keys( $desired_settings, self::INDEX_SETTINGS_HEALTH_AUTO_HEAL_KEYS );
$index_name = $indexable->get_index_name();
if ( method_exists( '\Automattic\VIP\Search\Search', 'should_load_new_ep' ) && \Automattic\VIP\Search\Search::should_load_new_ep() ) {
$result = $this->elasticsearch->update_index_settings( $index_name, $desired_settings_to_heal, false );
} else {
$result = $indexable->update_index_settings( $desired_settings_to_heal );
}
$result = $this->elasticsearch->update_index_settings( $index_name, $desired_settings_to_heal, false );

$index_version = $this->search->versioning->get_current_version_number( $indexable );

Expand Down
27 changes: 21 additions & 6 deletions search/includes/classes/class-queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ public function apply_settings() {
}

public function setup_hooks() {
// We should make sure to apply the settings again after the customer code have been loaded to ensure the consistency.
add_action( 'after_setup_theme', array( $this, 'apply_settings' ), PHP_INT_MAX );

add_action( 'saved_term', [ $this, 'offload_term_indexing_to_queue' ], 0, 3 ); // saved_term fires after SyncManager_Helper actions

add_action( 'pre_delete_term', [ $this, 'offload_indexing_to_queue' ] );
Expand Down Expand Up @@ -1084,10 +1087,10 @@ public function ratelimit_indexing( $bail, $sync_manager, $indexable_slug ) {

// Increment first to prevent overrunning ratelimiting
$increment = count( $sync_manager->sync_queue );
$index_count_in_period = self::index_count_incr( $increment );
$index_count_in_period = static::index_count_incr( $increment );

// If indexing operation ratelimiting is hit, queue index operations
if ( $index_count_in_period > self::$max_indexing_op_count || self::is_indexing_ratelimited() ) {
if ( $index_count_in_period > static::$max_indexing_op_count ) {
if ( class_exists( Prometheus_Collector::class ) ) {
Prometheus_Collector::increment_ratelimited_index_counter( Search::instance()->get_current_host(), $increment );
}
Expand All @@ -1103,6 +1106,7 @@ public function ratelimit_indexing( $bail, $sync_manager, $indexable_slug ) {
$this->log_index_ratelimiting_start();
}
} else {
static::turn_off_index_ratelimiting();
$this->clear_index_limiting_start_timestamp();
}

Expand Down Expand Up @@ -1171,6 +1175,15 @@ public static function turn_on_index_ratelimiting() {
return wp_cache_set( self::INDEX_QUEUEING_ENABLED_KEY, true, self::INDEX_COUNT_CACHE_GROUP, self::$index_queueing_ttl );
}

/**
* Turn off ratelimit indexing
*
* @return bool void
*/
public static function turn_off_index_ratelimiting() {
wp_cache_delete( self::INDEX_QUEUEING_ENABLED_KEY, self::INDEX_COUNT_CACHE_GROUP );
}

/**
* Get the current queue stats
*
Expand Down Expand Up @@ -1263,9 +1276,10 @@ public function delete_jobs_for_index_version( $indexable_slug, $index_version )
* @return int|bool New value on success, false on failure
*/
private static function index_count_incr( $increment = 1 ) {
if ( false === wp_cache_get( self::INDEX_COUNT_CACHE_KEY, self::INDEX_COUNT_CACHE_GROUP ) ) {
if ( false === wp_cache_get( static::INDEX_COUNT_CACHE_KEY, static::INDEX_COUNT_CACHE_GROUP ) ) {
// phpcs:ignore WordPressVIPMinimum.Performance.LowExpiryCacheTime.CacheTimeUndetermined
wp_cache_set( self::INDEX_COUNT_CACHE_KEY, 0, self::INDEX_COUNT_CACHE_GROUP, self::$index_count_ttl );
wp_cache_set( static::INDEX_COUNT_CACHE_KEY, 0, static::INDEX_COUNT_CACHE_GROUP, static::$index_count_ttl );
static::turn_off_index_ratelimiting();
}

return wp_cache_incr( self::INDEX_COUNT_CACHE_KEY, $increment, self::INDEX_COUNT_CACHE_GROUP );
Expand All @@ -1277,12 +1291,13 @@ private static function index_count_incr( $increment = 1 ) {
public function handle_index_limiting_start_timestamp() {
if ( false === static::get_indexing_rate_limit_start() ) {
$start_timestamp = time();
wp_cache_set( self::INDEX_RATE_LIMITED_START_CACHE_KEY, $start_timestamp, self::INDEX_COUNT_CACHE_GROUP );
// phpcs:ignore WordPressVIPMinimum.Performance.LowExpiryCacheTime.CacheTimeUndetermined
wp_cache_set( static::INDEX_RATE_LIMITED_START_CACHE_KEY, $start_timestamp, static::INDEX_COUNT_CACHE_GROUP );
}
}

public function clear_index_limiting_start_timestamp() {
wp_cache_delete( self::INDEX_RATE_LIMITED_START_CACHE_KEY, self::INDEX_COUNT_CACHE_GROUP );
wp_cache_delete( static::INDEX_RATE_LIMITED_START_CACHE_KEY, static::INDEX_COUNT_CACHE_GROUP );
}

/**
Expand Down
22 changes: 2 additions & 20 deletions search/includes/classes/class-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,27 +239,9 @@ public static function instance() {
return static::$instance;
}

/**
* Whether to load the latest ElasticPress version.
* Can be overridden by defining `VIP_SEARCH_USE_NEXT_EP` to false.
*
* @return bool Whether to load the latest version or not. Defaults to true.
*/
public static function should_load_new_ep() {
if ( defined( 'VIP_SEARCH_USE_NEXT_EP' ) && true !== constant( 'VIP_SEARCH_USE_NEXT_EP' ) ) {
return false;
}

return true;
}

protected function load_dependencies() {
// Load ElasticPress
if ( static::should_load_new_ep() ) {
require_once __DIR__ . '/../../elasticpress-next/elasticpress.php';
} else {
require_once __DIR__ . '/../../elasticpress/elasticpress.php';
}
require_once __DIR__ . '/../../elasticpress/elasticpress.php';

// Load health check cron job
require_once __DIR__ . '/class-healthjob.php';
Expand Down Expand Up @@ -1707,7 +1689,7 @@ public function filter__ep_post_mapping( $mapping ) {
public function filter__ep_user_mapping( $mapping ) {
$users_count = count_users();

if ( isset( $users_count->total_users ) && ( $users_count->total_users > self::USER_SHARD_THRESHOLD ) ) {
if ( isset( $users_count['total_users'] ) && ( $users_count['total_users'] > self::USER_SHARD_THRESHOLD ) ) {
$mapping['settings']['index.number_of_shards'] = 4;
}

Expand Down
6 changes: 1 addition & 5 deletions search/includes/functions/ep-get-query-log.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?php
if ( method_exists( '\Automattic\VIP\Search\Search', 'should_load_new_ep' ) && \Automattic\VIP\Search\Search::should_load_new_ep() ) {
require_once __DIR__ . '/../../elasticpress-next/elasticpress.php';
} else {
require_once __DIR__ . '/../../elasticpress/elasticpress.php';
}
require_once __DIR__ . '/../../elasticpress/elasticpress.php';

// Override query log to remove Authorization header.
function ep_get_query_log() {
Expand Down
4 changes: 2 additions & 2 deletions tests/search/includes/classes/test-class-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

require_once __DIR__ . '/../../../../search/search.php';
require_once __DIR__ . '/../../../../search/includes/classes/class-health.php';
require_once __DIR__ . '/../../../../search/elasticpress-next/includes/classes/Indexables.php'; // TODO: Switch back to `elasticpress` once we're ready to completely remove the old EP.
require_once __DIR__ . '/../../../../search/elasticpress-next/includes/classes/Elasticsearch.php'; // TODO: Switch back to `elasticpress` once we're ready to completely remove the old EP.
require_once __DIR__ . '/../../../../search/elasticpress/includes/classes/Indexables.php';
require_once __DIR__ . '/../../../../search/elasticpress/includes/classes/Elasticsearch.php';

class Health_Test extends WP_UnitTestCase {
/** @var array */
Expand Down
15 changes: 5 additions & 10 deletions tests/search/includes/classes/test-class-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
require_once __DIR__ . '/mock-header.php';
require_once __DIR__ . '/../../../../search/search.php';
require_once __DIR__ . '/../../../../search/includes/classes/class-versioning.php';
require_once __DIR__ . '/../../../../search/elasticpress-next/elasticpress.php'; // TODO: Switch back to `elasticpress` once we're ready to completely remove the old EP.
require_once __DIR__ . '/../../../../search/elasticpress/elasticpress.php';
require_once __DIR__ . '/../../../../prometheus.php';

class Search_Test extends WP_UnitTestCase {
Expand Down Expand Up @@ -387,13 +387,10 @@ public function test__vip_search_filter_filter__ep_user_mapping__large_site() {
Features::factory()->setup_features();

// Simulate a large site
$return_big_count = function () {
$counts = new stdClass();
$counts->avail_roles = 100;
$counts->total_users = 3000000;

return $counts;
};
$return_big_count = fn () => [
'avail_roles' => 100,
'total_users' => 3000000,
];

add_filter( 'pre_count_users', $return_big_count );

Expand All @@ -405,8 +402,6 @@ public function test__vip_search_filter_filter__ep_user_mapping__large_site() {
$settings = $mapping['settings'];
}
$this->assertEquals( 4, $settings['index.number_of_shards'] );

remove_filter( 'pre_count_users', $return_big_count );
}

public function test__vip_search_filter_ep_default_index_number_of_replicas() {
Expand Down
Loading

0 comments on commit 92eb440

Please sign in to comment.