Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable c.indexing during tests, but patch it to not defer operations: #5820

Merged
merged 1 commit into from
Jul 18, 2019

Conversation

lukasgraf
Copy link
Contributor

@lukasgraf lukasgraf commented Jul 12, 2019

We need to enable collective.indexing during tests in order to create Solr tests (because ftw.solr integrates itself by providing an IIndexQueueProcessor).

So we need collective.indexing's pluggable IndexQueueProcessor mechanism, but we don't want the unpredictable behavior of reindexes that are deferred until the end of the transaction during tests (or the queue getting flushed at arbitrary points).

We therefore patch the IndexQueue's operation methods so that they always immediately process the queue after being called.

Closes #5801

Note:
I checked for any negative effects on test runtime - wallclock time for tests on CI stayed exactly the same.

Checkliste

  • Changelog-Eintrag vorhanden/nötig?

@lukasgraf lukasgraf force-pushed the lg-use-collective-indexing-during-tests branch from a4a0070 to 34814a8 Compare July 12, 2019 14:14
@lukasgraf lukasgraf marked this pull request as ready for review July 12, 2019 14:32
@lukasgraf lukasgraf requested a review from a team July 12, 2019 14:32
@lukasgraf lukasgraf added this to the Sprint #2 milestone Jul 15, 2019
Copy link
Contributor

@njohner njohner left a comment

Choose a reason for hiding this comment

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

LGTM!

We need to enable collective.indexing during tests in order to
create Solr tests (because ftw.solr integrates itself by providing
an IIndexQueueProcessor).

So we need c.indexing's pluggable IndexQueueProcessor mechanism, but
we don't want the unpredictable behavior of reindexes that are deferred
until the end of the transaction during tests (or the queue getting
flushed at arbitrary points).

We therefore patch the IndexQueue's operation methods so that they
always immediately process the queue after being called.
@lukasgraf lukasgraf force-pushed the lg-use-collective-indexing-during-tests branch from 34814a8 to 2fade44 Compare July 15, 2019 14:57
@lukasgraf lukasgraf merged commit 64f4938 into master Jul 18, 2019
@lukasgraf lukasgraf deleted the lg-use-collective-indexing-during-tests branch July 18, 2019 11:34
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.

Solr Testing - Step 1
2 participants