From a849edbeae9241e74f8da1b1b1545b697fc19917 Mon Sep 17 00:00:00 2001 From: Austin DeNoble Date: Thu, 22 Aug 2024 14:03:12 -0400 Subject: [PATCH] return false for timeout case in WaitUntilIndexReady --- pinecone/test_suite.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pinecone/test_suite.go b/pinecone/test_suite.go index 73b6a9c..d1ecb11 100644 --- a/pinecone/test_suite.go +++ b/pinecone/test_suite.go @@ -141,10 +141,13 @@ func WaitUntilIndexReady(ts *IntegrationTests, ctx context.Context) (bool, error totalSeconds := time.Since(start) + if totalSeconds >= maxWaitTimeSeconds { + return false, fmt.Errorf("Index \"%s\" not ready after %f seconds", ts.idxName, totalSeconds.Seconds()) + } + fmt.Printf("Index \"%s\" not ready yet, retrying... (%f/%f)\n", ts.idxName, totalSeconds.Seconds(), maxWaitTimeSeconds.Seconds()) time.Sleep(delay) } - } func createVectorsForUpsert() []*Vector {