Use Server::wait_task() instead of Index::wait_task() for tasks IT tests

Revert the debugging helper that dumped the thread stack traces.
Try with 400 max attempts for the task success/failure (200 secs)

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
Martin Tzvetanov Grigorov 2025-06-06 13:45:05 +03:00
parent 1b4d344e18
commit 63ccd19ab1
No known key found for this signature in database
GPG key ID: 3194FD8C1AE300EF
4 changed files with 39 additions and 51 deletions

View file

@ -399,14 +399,9 @@ impl<State> Server<State> {
pub async fn wait_task(&self, update_id: u64) -> Value {
// try several times to get status, or panic to not wait forever
let url = format!("/tasks/{}", update_id);
// Increase timeout for vector-related tests
let max_attempts = if update_id > 1000 {
400 // 200 seconds for vector tests
} else {
1000 // 50 seconds for other tests
};
let max_attempts = 400; // 200 seconds total, 0.5s per attempt
for _ in 0..max_attempts {
for i in 0..max_attempts {
let (response, status_code) = self.service.get(&url).await;
assert_eq!(200, status_code, "response: {}", response);
@ -416,13 +411,9 @@ impl<State> Server<State> {
// wait 0.5 second.
sleep(Duration::from_millis(500)).await;
}
let handle = tokio::runtime::Handle::current();
if let Ok(dump) = tokio::time::timeout(Duration::from_secs(2), handle.dump()).await {
for (i, task) in dump.tasks().iter().enumerate() {
let trace = task.trace();
println!("TASK {i}:");
println!("{trace}\n");
if i == max_attempts - 1 {
dbg!(response);
}
}
panic!("Timeout waiting for update id");