1414import java .io .IOException ;
1515import java .util .List ;
1616
17- import org .awaitility .Awaitility ;
1817import org .testng .SkipException ;
1918import org .testng .annotations .AfterClass ;
2019import org .testng .annotations .Test ;
@@ -40,23 +39,25 @@ public class TestRediSearchConnectorSmokeTest extends BaseConnectorSmokeTest {
4039
4140 private RediSearchServer redisearch ;
4241
43- private void populateBeers () throws IOException {
42+ private void populateBeers () throws IOException , InterruptedException {
4443 deleteBeers ();
4544 Beers .populateIndex (redisearch .getTestContext ().getConnection ());
4645 }
4746
48- private void createBeersIndex () {
47+ private void createBeersIndex () throws InterruptedException {
4948 deleteBeers ();
5049 Beers .createIndex (redisearch .getTestContext ().getConnection ());
5150 }
5251
53- private void deleteBeers () {
52+ private void deleteBeers () throws InterruptedException {
5453 try {
5554 redisearch .getTestContext ().sync ().ftDropindexDeleteDocs (Beers .INDEX );
5655 } catch (Exception e ) {
5756 // ignore
5857 }
59- Awaitility .await ().until (() -> redisearch .getTestContext ().sync ().dbsize () == 0 );
58+ while (redisearch .getTestContext ().sync ().dbsize () > 0 ) {
59+ Thread .sleep (10 );
60+ }
6061 }
6162
6263 @ Override
@@ -126,19 +127,19 @@ protected QueryRunner createQueryRunner() throws Exception {
126127 }
127128
128129 @ Test
129- public void testNonIndexedFields () throws IOException {
130+ public void testNonIndexedFields () throws IOException , InterruptedException {
130131 populateBeers ();
131132 getQueryRunner ().execute ("select id, last_mod from beers" );
132133 }
133134
134135 @ Test
135- public void testBuiltinFields () throws IOException {
136+ public void testBuiltinFields () throws IOException , InterruptedException {
136137 populateBeers ();
137138 getQueryRunner ().execute ("select _id, _score from beers" );
138139 }
139140
140141 @ Test
141- public void testCountEmptyIndex () throws IOException {
142+ public void testCountEmptyIndex () throws IOException , InterruptedException {
142143 createBeersIndex ();
143144 assertQuery ("SELECT count(*) FROM beers" , "VALUES 0" );
144145 }
@@ -165,7 +166,7 @@ public void testShowCreateTable() {
165166 }
166167
167168 @ Test
168- public void testInsertIndex () throws IOException {
169+ public void testInsertIndex () throws IOException , InterruptedException {
169170 createBeersIndex ();
170171 assertUpdate ("INSERT INTO beers (id, name) VALUES ('abc', 'mybeer')" , 1 );
171172 assertThat (query ("SELECT id, name FROM beers" )).matches ("VALUES (VARCHAR 'abc', VARCHAR 'mybeer')" );
0 commit comments