diff --git a/tests/unit/test_layer.py b/tests/unit/test_layer.py index 284bde0b422905af4711eb386f5a03e1f56ae78d..241e3e50cb801a479023ab47b923cced3aed624a 100644 --- a/tests/unit/test_layer.py +++ b/tests/unit/test_layer.py @@ -280,7 +280,7 @@ class TestRouteLayer: route_layer = RouteLayer( encoder=openai_encoder, routes=routes, index=pineconeindex ) - time.sleep(5) # allow for index to be populated + time.sleep(10) # allow for index to be populated query_result = route_layer(text="Hello", route_filter=["Route 1"]).name try: @@ -288,6 +288,9 @@ class TestRouteLayer: except ValueError: assert True + # delete index + pineconeindex.delete_index() + assert query_result in ["Route 1"] def test_namespace_pinecone_index(self, openai_encoder, routes, index_cls): @@ -296,7 +299,7 @@ class TestRouteLayer: route_layer = RouteLayer( encoder=openai_encoder, routes=routes, index=pineconeindex ) - time.sleep(5) # allow for index to be populated + time.sleep(10) # allow for index to be populated query_result = route_layer(text="Hello", route_filter=["Route 1"]).name try: @@ -304,6 +307,9 @@ class TestRouteLayer: except ValueError: assert True + # delete index + pineconeindex.delete_index() + assert query_result in ["Route 1"] def test_query_with_no_index(self, openai_encoder, index_cls):