Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use provided (simulated) time in qlogs #2211

Closed
mxinden opened this issue Oct 31, 2024 · 2 comments · Fixed by #2216
Closed

test: use provided (simulated) time in qlogs #2211

mxinden opened this issue Oct 31, 2024 · 2 comments · Fixed by #2216

Comments

@mxinden
Copy link
Collaborator

mxinden commented Oct 31, 2024

When logging qlog events, we currently use qlog's add_event_data_now which internally calls std::time::Instant::now().

s.add_event_data_now(ev_data)?;

This is fine when capturing qlogs in real-time.

Problem arises when used with the text_fixtures::Simulator, which simulates time, i.e. where std::time::Instant::now() has no meaning.

I suggest we use qlogs add_event_data_with_instant, using now: Instant available e.g. through now parameter on Connection::process.

pub fn process(&mut self, dgram: Option<Datagram<impl AsRef<[u8]>>>, now: Instant) -> Output {

Status: preparing a draft. Thus far, this is very noisy, given that now needs to be passed across many layers.

@larseggert
Copy link
Collaborator

Sound good.

Related, it would be nice to see virtual time in the debug output for tests, and not clock time.

@mxinden
Copy link
Collaborator Author

mxinden commented Nov 1, 2024

I sketched a fix for this issue in #2212. Long story short, I don't think it is worth it. See PR description in #2212.

Let me know if you think otherwise, or have a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants