Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ private void testPreparedStatement(LogLevel loglevel) throws Exception {
props.setProperty(QueryServices.LOG_LEVEL, loglevel.name());
Connection conn = DriverManager.getConnection(getUrl(), props);
assertEquals(conn.unwrap(PhoenixConnection.class).getLogLevel(), loglevel);
final MyClock clock = new MyClock(100);
// The fixed clock also drives the server clock. Start it at the current time, so server
// calls do not expire when the test resets the clock.
final MyClock clock = new MyClock(EnvironmentEdgeManager.currentTimeMillis());
EnvironmentEdgeManager.injectEdge(clock);
try {
String query = "SELECT * FROM " + tableName + " where V = ?";
Expand Down Expand Up @@ -323,7 +325,7 @@ private void testPreparedStatement(LogLevel loglevel) throws Exception {
assertTrue(LogLevel.TRACE == loglevel
? rs.getString(SCAN_METRICS_JSON).contains("scanMetrics")
: rs.getString(SCAN_METRICS_JSON) == null);
assertEquals(rs.getTimestamp(START_TIME).getTime(), 100);
assertEquals(clock.time, rs.getTimestamp(START_TIME).getTime());
assertEquals(rs.getString(TENANT_ID), null);
}
}
Expand Down
Loading