Skip to content

Commit

Permalink
improve unit test for fail sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
jiafu1115 committed Nov 10, 2016
1 parent 2bfd299 commit 6355973
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test/java/org/influxdb/InfluxDBTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ public void testWriteStringData() {
public void testWriteStringDataThroughUDP() {
String measurement = TestUtils.getRandomMeasurement();
this.influxDB.write(UDP_PORT, measurement + ",atag=test idle=90,usertime=9,system=1");
//write with UDP may be executed on server after query with HTTP. so sleep 1s to handle this case
Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS);
//write with UDP may be executed on server after query with HTTP. so sleep 2s to handle this case
Uninterruptibles.sleepUninterruptibly(2, TimeUnit.SECONDS);
Query query = new Query("SELECT * FROM " + measurement + " GROUP BY *", UDP_DATABASE);
QueryResult result = this.influxDB.query(query);
Assert.assertFalse(result.getResults().get(0).getSeries().get(0).getTags().isEmpty());
Expand Down

0 comments on commit 6355973

Please sign in to comment.