Assert that version checking won't throw on startup (#1512)

# Overview

Previously if the coproc came up later, getProperty would return the
string literal "null", which made us print the BFW. Add tests to make
sure that we don't do that anymore by rebooting a sim coproc +
robot in a combination of different orders.
This commit is contained in:
Matt
2024-11-01 20:50:21 -07:00
committed by GitHub
parent 5e1a93950e
commit 7a4ea3dd56
13 changed files with 305 additions and 67 deletions

View File

@@ -30,7 +30,7 @@ public class PhotonPipelineMetadata implements PhotonStructSerializable<PhotonPi
// Mirror of the heartbeat entry -- monotonically increasing
public long sequenceID;
// Time from last Time Sync Pong received and the construction of this metadata
// Time from last Time Sync Pong received and the construction of this metadata, in uS
public long timeSinceLastPong;
public PhotonPipelineMetadata(
@@ -73,12 +73,14 @@ public class PhotonPipelineMetadata implements PhotonStructSerializable<PhotonPi
@Override
public String toString() {
return "PhotonPipelineMetadata [sequenceID="
+ sequenceID
+ ", captureTimestampMicros="
return "PhotonPipelineMetadata [captureTimestampMicros="
+ captureTimestampMicros
+ ", publishTimestampMicros="
+ publishTimestampMicros
+ ", sequenceID="
+ sequenceID
+ ", timeSinceLastPong="
+ timeSinceLastPong
+ "]";
}
@@ -86,9 +88,10 @@ public class PhotonPipelineMetadata implements PhotonStructSerializable<PhotonPi
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (sequenceID ^ (sequenceID >>> 32));
result = prime * result + (int) (captureTimestampMicros ^ (captureTimestampMicros >>> 32));
result = prime * result + (int) (publishTimestampMicros ^ (publishTimestampMicros >>> 32));
result = prime * result + (int) (sequenceID ^ (sequenceID >>> 32));
result = prime * result + (int) (timeSinceLastPong ^ (timeSinceLastPong >>> 32));
return result;
}
@@ -98,9 +101,10 @@ public class PhotonPipelineMetadata implements PhotonStructSerializable<PhotonPi
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
PhotonPipelineMetadata other = (PhotonPipelineMetadata) obj;
if (sequenceID != other.sequenceID) return false;
if (captureTimestampMicros != other.captureTimestampMicros) return false;
if (publishTimestampMicros != other.publishTimestampMicros) return false;
if (sequenceID != other.sequenceID) return false;
if (timeSinceLastPong != other.timeSinceLastPong) return false;
return true;
}

View File

@@ -69,5 +69,6 @@ public class PhotonPipelineResultProto
msg.setSequenceId(value.metadata.getSequenceID());
msg.setCaptureTimestampMicros(value.metadata.getCaptureTimestampMicros());
msg.setNtPublishTimestampMicros(value.metadata.getPublishTimestampMicros());
msg.setTimeSinceLastPongMicros(value.metadata.timeSinceLastPong);
}
}