https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44321 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 212837 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212837&action=edit Bug 44321: Wait for indexing jobs in search_utf8.t with Elasticsearch t/db_dependent/www/search_utf8.t fails intermittently with Elasticsearch 8 ("UTF-8 chars are correctly present. Good"). After importing a staged batch, t::lib::Mocks::Zebra::load_records_ui only sleeps 10 seconds. With Elasticsearch, indexing is done by background jobs: marc_import_commit_batch, which then enqueues update_elastic_index, picked up by es_indexer_daemon.pl. When the workers poll the database, each job can wait up to 10 seconds before being picked up; on KTD update_elastic_index started 17-28 seconds after being enqueued, so the records were often searched before they were indexed. When SearchEngine is Elasticsearch, wait for those jobs to finish (timeout 120 seconds), then give Elasticsearch 2 seconds to refresh the index. Zebra keeps the existing sleep. Test plan: 1. ktd --search-engine es8 up 2. prove -v t/db_dependent/www/search_utf8.t (KOHA_INTRANET_URL and KOHA_OPAC_URL must be set) 3. Repeat several times, including straight after starting KTD and under load 4. All checks pass every time Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.