-
-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XWIKI-22323: Refactoring operation should wait for the Solr index to …
…be empty before proceeding (#3403) * Introduce a new ReadyIndicator interface that allows waiting for the link index to become ready while getting a progress percentage. * In the BackLinkUpdaterListener, wait for the index to become ready when a job is active and display the indexing progress. * Provide a ready indicator including indexing progress in the Solr indexer. * Modernize the jobRunner JavaScript code * Continue polling the job status when the job is waiting to detect when a question is answered in the background (by another browser tab or on the server). * Add support in entity requests to indicate if the job should wait for indexing to finish. * Ask the user after 10 seconds if the refactoring should wait for link indexing to finish. * Wait for link indexing before adapting links after moving attachments * Add unit and integration tests. * Adapt the code to Java 11 and older Mockito. * Backport TestUtils#serializeLocalReference. (cherry picked from commit 00b8440)
- Loading branch information
Showing
30 changed files
with
1,595 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...i-platform-flamingo-skin-test-docker/src/main/java/org/xwiki/test/SleepScriptService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.xwiki.test; | ||
|
||
import javax.inject.Named; | ||
import javax.inject.Singleton; | ||
|
||
import org.xwiki.component.annotation.Component; | ||
import org.xwiki.script.service.ScriptService; | ||
|
||
/** | ||
* A script service that provides a sleep method for testing purposes. | ||
* | ||
* @version $Id$ | ||
*/ | ||
@Component | ||
@Singleton | ||
@Named("sleep") | ||
public class SleepScriptService implements ScriptService | ||
{ | ||
/** | ||
* Sleep for a given number of seconds. | ||
* | ||
* @param seconds the number of seconds to sleep | ||
*/ | ||
public void sleepInSolr(long seconds) | ||
{ | ||
// Check if we're in the Solr indexing thread. | ||
if (Thread.currentThread().getName().equals("XWiki Solr index thread")) { | ||
try { | ||
Thread.sleep(seconds * 1000); | ||
} catch (InterruptedException e) { | ||
Thread.currentThread().interrupt(); | ||
} | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...-test/xwiki-platform-flamingo-skin-test-docker/src/main/resources/META-INF/components.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
org.xwiki.test.CustomUserUpdatedDocumentEventListener | ||
org.xwiki.test.TestMacro | ||
org.xwiki.test.SleepScriptService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.