Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/org/labkey/test/util/search/SearchAdminAPIHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
public abstract class SearchAdminAPIHelper
{

@LogMethod(quiet = true)
public static void purgeForContainer(String containerPath)
{
var cmd = new SimplePostCommand("search", "cancelIndexing");
executeCommand(cmd, containerPath);
}

public static void waitForIndexer()
{
waitForIndexer(WAIT_FOR_PAGE);
Expand All @@ -57,7 +64,7 @@ public static void waitForIndexer(int timeout)
var cmd = new SimplePostCommand("search", "waitForIndexer");
cmd.setTimeout(timeout);

executeWaitForIndexer(cmd);
executeCommand(cmd, null);
}

public static void waitForIndexerBackground()
Expand All @@ -71,9 +78,9 @@ public static void waitForIndexerBackground(int timeout)
// Invoke a special server action that waits until all previous indexer tasks are complete, even wait for background indexing tasks to complete (e.g. deleteContainer)
var cmd = new SimplePostCommand("search", "waitForIndexer");
cmd.setTimeout(timeout);
cmd.setParameters(Map.of("priority", "background"));
cmd.setParameters(Map.of("priority", "idle"));

executeWaitForIndexer(cmd);
executeCommand(cmd, null);
}

@LogMethod(quiet = true)
Expand Down Expand Up @@ -106,11 +113,11 @@ public static void waitForSearchServiceBootstrap(Connection cn)
while (!timer.isTimedOut());
}

private static void executeWaitForIndexer(PostCommand cmd)
private static void executeCommand(PostCommand<?> cmd, String containerPath)
{
try
{
var response = cmd.execute(WebTestHelper.getRemoteApiConnection(), null);
var response = cmd.execute(WebTestHelper.getRemoteApiConnection(), containerPath);
assertEquals("WaitForIndexer action timed out", HttpStatus.SC_OK, response.getStatusCode());
} catch (Exception cmdException)
{
Expand Down