Skip to content

Commit

Permalink
Apply fix for gRPC tests as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Jotschi committed Feb 2, 2023
1 parent 2b05dad commit 03f9b51
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ public abstract class AbstractContainerTest {
@Rule
public QDrantContainer qdrant = new QDrantContainer();

protected void sleep(int i) {
try {
Thread.sleep(i);
} catch (InterruptedException e) {
e.printStackTrace();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public void testCreateCollectionSnapshot() throws Exception {
createCollection(TEST_COLLECTION_NAME);
client.createSnapshot(TEST_COLLECTION_NAME).sync();
assertEquals(1, client.listSnapshots(TEST_COLLECTION_NAME).sync().getSnapshotDescriptionsCount());
// The snapshot filename is named via seconds. We need to pass some time to allow for creation of another file
sleep(2000);
client.createSnapshot(TEST_COLLECTION_NAME).sync();
assertEquals(2, client.listSnapshots(TEST_COLLECTION_NAME).sync().getSnapshotDescriptionsCount());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,6 @@ protected <T extends RestResponse> T invoke(QDrantClientRequest<T> request) thro
}
}

protected void sleep(int i) {
try {
Thread.sleep(i);
} catch (InterruptedException e) {
e.printStackTrace();
}

}

protected void createTestCollection() throws HttpErrorException {
CollectionCreateRequest request = new CollectionCreateRequest();
request.setVectors(VectorParams.of(4, EUCLID));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public void testCreateStorageSnapshot() throws Exception {
public void testListStorageSnapshot() throws Exception {
invoke(client.createStorageSnapshot());
createCollection(TEST_COLLECTION_NAME);
// The snapshot filename is named via seconds. We need to pass some time to allow for creation of another file
sleep(2000);
invoke(client.createStorageSnapshot());
List<SnapshotDescription> snapshots = invoke(client.listStorageSnapshots()).getResult();
Expand Down

0 comments on commit 03f9b51

Please sign in to comment.