Skip to content

Commit 489f4d7

Browse files
committed
Fixes TimeDifferenceTest and FlightSqlDriverTest
1 parent 8ae1aaa commit 489f4d7

3 files changed

Lines changed: 26 additions & 47 deletions

File tree

README.md

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
- https://github.com/InfluxCommunity/influxdb3-java/issues/224
1111
- https://github.com/influxdata/influxdb/issues/25983
1212
- https://github.com/apache/arrow-java/issues/636
13+
- https://github.com/apache/arrow-java/pull/464
14+
- https://github.com/apache/arrow-java/issues/463
1315
- Verified unit test under Ubuntu 22.04.4 LTS with `SDKMAN!` and `Docker CE`.
1416

1517
```shell
@@ -46,7 +48,7 @@ sdk use java 21.0.6-ms
4648
- The log is as follows.
4749

4850
```shell
49-
$ ./mvnw -T 1C -Dtest=TimeDifferenceTest clean test
51+
$ ./mvnw -T 1C clean test
5052
[INFO] Scanning for projects...
5153
[INFO]
5254
[INFO] Using the MultiThreadedBuilder implementation with a thread count of 16
@@ -78,55 +80,38 @@ $ ./mvnw -T 1C -Dtest=TimeDifferenceTest clean test
7880
[INFO] -------------------------------------------------------
7981
[INFO] T E S T S
8082
[INFO] -------------------------------------------------------
81-
[INFO] Running io.github.linghengqian.TimeDifferenceTest
83+
[INFO] Running io.github.linghengqian.FlightSqlDriverTest
8284
SLF4J(W): No SLF4J providers were found.
8385
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
8486
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
85-
2月 25, 2025 11:11:36 上午 org.apache.arrow.driver.jdbc.shaded.org.apache.arrow.memory.BaseAllocator <clinit>
87+
2月 26, 2025 3:24:25 下午 org.apache.arrow.driver.jdbc.shaded.org.apache.arrow.memory.BaseAllocator <clinit>
8688
信息: Debug mode disabled. Enable with the VM option -Darrow.memory.debug.allocator=true.
87-
2月 25, 2025 11:11:36 上午 org.apache.arrow.driver.jdbc.shaded.org.apache.arrow.memory.DefaultAllocationManagerOption getDefaultAllocationManagerFactory
89+
2月 26, 2025 3:24:25 下午 org.apache.arrow.driver.jdbc.shaded.org.apache.arrow.memory.DefaultAllocationManagerOption getDefaultAllocationManagerFactory
8890
信息: allocation manager type not specified, using netty as the default type
89-
2月 25, 2025 11:11:36 上午 org.apache.arrow.driver.jdbc.shaded.org.apache.arrow.memory.CheckAllocator reportResult
91+
2月 26, 2025 3:24:25 下午 org.apache.arrow.driver.jdbc.shaded.org.apache.arrow.memory.CheckAllocator reportResult
9092
信息: Using DefaultAllocationManager at memory/netty/DefaultAllocationManagerFactory.class
91-
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 3.419 s <<< FAILURE! -- in io.github.linghengqian.TimeDifferenceTest
92-
[ERROR] io.github.linghengqian.TimeDifferenceTest.test -- Time elapsed: 3.354 s <<< FAILURE!
93-
java.lang.AssertionError:
94-
95-
Expected: is <2025-02-25T03:11:24.614425710Z>
96-
but: was <2025-02-24T19:11:24.614425710Z>
97-
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
98-
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
99-
at io.github.linghengqian.TimeDifferenceTest.queryDataByJdbcDriver(TimeDifferenceTest.java:89)
100-
at io.github.linghengqian.TimeDifferenceTest.test(TimeDifferenceTest.java:50)
101-
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
102-
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
103-
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
104-
93+
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.526 s -- in io.github.linghengqian.FlightSqlDriverTest
94+
[INFO] Running io.github.linghengqian.FlightSqlTest
95+
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.088 s -- in io.github.linghengqian.FlightSqlTest
96+
[INFO] Running io.github.linghengqian.influxdb3java.PointValuesTest
97+
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.822 s -- in io.github.linghengqian.influxdb3java.PointValuesTest
98+
[INFO] Running io.github.linghengqian.influxdb3java.InfluxQlTest
99+
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s -- in io.github.linghengqian.influxdb3java.InfluxQlTest
100+
[INFO] Running io.github.linghengqian.influxdb3java.SqlTest
101+
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.796 s -- in io.github.linghengqian.influxdb3java.SqlTest
102+
[INFO] Running io.github.linghengqian.influxdb3java.SqlParamsTest
103+
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.977 s -- in io.github.linghengqian.influxdb3java.SqlParamsTest
104+
[INFO] Running io.github.linghengqian.TimeDifferenceTest
105+
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.025 s -- in io.github.linghengqian.TimeDifferenceTest
105106
[INFO]
106107
[INFO] Results:
107108
[INFO]
108-
[ERROR] Failures:
109-
[ERROR] TimeDifferenceTest.test:50->queryDataByJdbcDriver:89
110-
Expected: is <2025-02-25T03:11:24.614425710Z>
111-
but: was <2025-02-24T19:11:24.614425710Z>
112-
[INFO]
113-
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
109+
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0
114110
[INFO]
115111
[INFO] ------------------------------------------------------------------------
116-
[INFO] BUILD FAILURE
112+
[INFO] BUILD SUCCESS
117113
[INFO] ------------------------------------------------------------------------
118-
[INFO] Total time: 4.894 s (Wall Clock)
119-
[INFO] Finished at: 2025-02-25T11:11:38+08:00
114+
[INFO] Total time: 15.876 s (Wall Clock)
115+
[INFO] Finished at: 2025-02-26T15:24:35+08:00
120116
[INFO] ------------------------------------------------------------------------
121-
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.2:test (default-test) on project influxdb-3-core-jdbc-test: There are test failures.
122-
[ERROR]
123-
[ERROR] See /home/linghengqian/TwinklingLiftWorks/git/public/influxdb-3-core-jdbc-test/target/surefire-reports for the individual test results.
124-
[ERROR] See dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
125-
[ERROR] -> [Help 1]
126-
[ERROR]
127-
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
128-
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
129-
[ERROR]
130-
[ERROR] For more information about the errors and possible solutions, please read the following articles:
131-
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
132117
```

src/test/java/io/github/linghengqian/FlightSqlDriverTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import java.time.Instant;
1717

1818
import static org.hamcrest.CoreMatchers.is;
19-
import static org.hamcrest.CoreMatchers.notNullValue;
2019
import static org.hamcrest.MatcherAssert.assertThat;
2120

2221
@SuppressWarnings({"SqlNoDataSourceInspection", "HttpUrlsUsage", "resource"})
@@ -59,9 +58,7 @@ private void queryData() throws SQLException {
5958
assertThat(resultSet.getString("location"), is("London"));
6059
assertThat(resultSet.getString("value"), is("30.01"));
6160
assertThat(Timestamp.from(magicTime).getTime(), is(magicTime.toEpochMilli()));
62-
assertThat(resultSet.getString("time"), notNullValue());
63-
// todo linghengqian why fail?
64-
// assertThat(resultSet.getTimestamp("time").getTime(), is(magicTime.toEpochMilli()));
61+
assertThat(resultSet.getObject("time", Instant.class), is(magicTime));
6562
}
6663
}
6764
}

src/test/java/io/github/linghengqian/TimeDifferenceTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.time.ZoneOffset;
2626

2727
import static org.hamcrest.CoreMatchers.is;
28-
import static org.hamcrest.CoreMatchers.notNullValue;
2928
import static org.hamcrest.MatcherAssert.assertThat;
3029

3130
@SuppressWarnings({"SqlNoDataSourceInspection", "HttpUrlsUsage", "resource"})
@@ -84,9 +83,7 @@ private void queryDataByJdbcDriver() throws SQLException {
8483
assertThat(resultSet.next(), is(true));
8584
assertThat(resultSet.getString("location"), is("London"));
8685
assertThat(resultSet.getString("value"), is("30.01"));
87-
assertThat(resultSet.getTimestamp("time"), notNullValue());
88-
// todo linghengqian why fail?
89-
assertThat(resultSet.getTimestamp("time").toInstant(), is(magicTime));
86+
assertThat(resultSet.getObject("time", Instant.class), is(magicTime));
9087
}
9188
}
9289
}

0 commit comments

Comments
 (0)