Replay log files without start times
We were trying to solve the timestamp problem for them unsuccessfully.
Turns out our solver isn't a bit fan of solving for min_time...
These times make no sense to have in our interpolation table, so just
don't solve for them.
Change-Id: Iac1fdfb75b83bb6f2c6417caaa436d44e7836365
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/events/logging/logger_test.cc b/aos/events/logging/logger_test.cc
index 6d45413..55bf687 100644
--- a/aos/events/logging/logger_test.cc
+++ b/aos/events/logging/logger_test.cc
@@ -2739,8 +2739,21 @@
EXPECT_TRUE(timestamp_file_count == 2u || timestamp_file_count == 4u);
- // TODO(austin): Finish reading it. We don't have a valid start time so
- // log_reader gets rather grumpy.
+ // Confirm that we can actually sort the resulting log and read it.
+ {
+ LogReader reader(SortParts(filenames));
+
+ SimulatedEventLoopFactory log_reader_factory(reader.configuration());
+ log_reader_factory.set_send_delay(chrono::microseconds(0));
+
+ // This sends out the fetched messages and advances time to the start of
+ // the log file.
+ reader.Register(&log_reader_factory);
+
+ log_reader_factory.Run();
+
+ reader.Deregister();
+ }
}
// Tests that we properly handle one direction of message_bridge being
diff --git a/aos/network/multinode_timestamp_filter.cc b/aos/network/multinode_timestamp_filter.cc
index 72b1cc5..d6419a0 100644
--- a/aos/network/multinode_timestamp_filter.cc
+++ b/aos/network/multinode_timestamp_filter.cc
@@ -1355,7 +1355,10 @@
.boot = next_boot,
.time = timestamp_mappers_[node_a_index]->monotonic_start_time(
next_boot)};
- if (next_start_time < next_node_time) {
+ // If we don't have a start time, it doesn't make sense to solve for it.
+ // Ignore that case.
+ if (next_start_time < next_node_time &&
+ next_start_time.time != monotonic_clock::min_time) {
VLOG(1) << "Candidate for node " << node_a_index
<< " is the next startup time, " << next_start_time;
next_node_time = next_start_time;