File tree Expand file tree Collapse file tree
integration-test/src/test/java/org/apache/iotdb/db/it Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333import org .apache .iotdb .it .framework .IoTDBTestRunner ;
3434import org .apache .iotdb .itbase .category .ClusterIT ;
3535import org .apache .iotdb .itbase .category .LocalStandaloneIT ;
36+ import org .apache .iotdb .itbase .exception .InconsistentDataException ;
3637
3738import org .apache .tsfile .enums .TSDataType ;
3839import org .apache .tsfile .exception .write .WriteProcessException ;
@@ -222,22 +223,29 @@ public void testWithNewModFileAndLoadAttributes()
222223 tmpDir .getAbsolutePath (), databaseName ));
223224
224225 boolean databaseFound = false ;
225- out :
226226 for (int i = 0 ; i < 10 ; i ++) {
227227 try (final ResultSet resultSet = statement .executeQuery ("show databases" )) {
228228 while (resultSet .next ()) {
229229 final String currentDatabase = resultSet .getString (1 );
230230 if (databaseName .equalsIgnoreCase (currentDatabase )) {
231231 databaseFound = true ;
232- break out ;
232+ break ;
233233 }
234234 }
235+ } catch (InconsistentDataException ignored ) {
236+ // Async load propagates the new database metadata to different DataNodes at
237+ // slightly different times, so "show databases" may be inconsistent transiently.
238+ }
235239
236- try {
237- Thread .sleep (1000 );
238- } catch (InterruptedException e ) {
239- break ;
240- }
240+ if (databaseFound ) {
241+ break ;
242+ }
243+
244+ try {
245+ Thread .sleep (1000 );
246+ } catch (InterruptedException e ) {
247+ Thread .currentThread ().interrupt ();
248+ break ;
241249 }
242250 }
243251 Assert .assertTrue (
You can’t perform that action at this time.
0 commit comments