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

Report: logs order probably isn't correct. #6

Open
o0Ignition0o opened this issue Jan 11, 2022 · 0 comments
Open

Report: logs order probably isn't correct. #6

o0Ignition0o opened this issue Jan 11, 2022 · 0 comments

Comments

@o0Ignition0o
Copy link
Contributor

When building the logs report, we're iterating through the spans, and appending the logs in the "spans" order.

There might be a bug hidden somewhere if we use delay features, eg:

#[tokio::main]
async fn main() {
  let f1 = tokio::task::spawn(async { 
    tokio::time::sleep(std::time::Duration::from_secs(2)).await;
    tracing::info!("second log entry");
  });

  let f2 = tokio::task::spawn(async { 
    tokio::time::sleep(std::time::Duration::from_secs(1)).await;
    tracing::info!("first log entry");
  });
  
  let _ = tokio::join!(f1, f2);
}

We would expect f2's log to apear before f1's.

Let's add a test that covers it, and maybe update the Report generating mechanism so it passes.

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

No branches or pull requests

1 participant