[tansiv-client] TestActor::check has no effect on the tests outcome => possible reason TestActor::check might be never called
Step to reproduce:
- Force a failure somewhere
diff --git a/src/client/tansiv-client/src/connector/unix.rs b/src/client/tansiv-client/src/connector/unix.rs
index ad2ecbc..b870906 100644
--- a/src/client/tansiv-client/src/connector/unix.rs
+++ b/src/client/tansiv-client/src/connector/unix.rs
@@ -600,7 +600,7 @@ mod test {
let seconds = ref_send_time.as_secs();
let useconds = ref_send_time.subsec_micros();
TestActor::check_eq(msg.send_time.seconds, seconds, "Received wrong value for Time::seconds")?;
- TestActor::check_eq(msg.send_time.useconds, useconds as u64, "Received wrong value for Time::useconds")?;
+ TestActor::check_eq(msg.send_time.useconds, useconds + 1 as u64, "Received wrong value for Time::useconds")?;
let payload_len = msg.packet.size as usize;
TestActor::check_eq(&buffer[..payload_len], ref_payload.deref(), "Received wrong payload")
} else {
My understanding is that:
- Child Actors exit with status code of 0 (https://gitlab.inria.fr/tansiv/tansiv/-/blob/76fdca497c7866fa2f13ee64d3cef2a3e82bdcd9/src/client/tansiv-client/src/connector/unix.rs#L108 )
- Parent process doesn't care about the actual exit code of the child: https://gitlab.inria.fr/tansiv/tansiv/-/blob/76fdca497c7866fa2f13ee64d3cef2a3e82bdcd9/src/client/tansiv-client/src/connector/unix.rs#L136
EDIT: Looks like there's a race here:
- https://gitlab.inria.fr/tansiv/tansiv/-/blob/76fdca497c7866fa2f13ee64d3cef2a3e82bdcd9/src/client/tansiv-client/src/connector/unix.rs#L284-290 If the child actor is busy working it will be killed (gracefully) by its parent :(
Maybe we need to fix that somehow (I've been busy with curating the tests for the flatbuffers when facing this)