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

errors updated to success with set_success() show up in error summary #370

Closed
jeremyandrews opened this issue Oct 18, 2021 · 2 comments
Closed

Comments

@jeremyandrews
Copy link
Member

Create a task that intentionally loads a 404 page, for example:

// Load a random non-existent and uncached page.
async fn random_404_page(user: &mut GooseUser) -> GooseTaskResult {
    let mut goose = user
        .get(&format!(
            "{}/{}/{}",
            goose_eggs::text::random_word(6),
            goose_eggs::text::random_word(4),
            goose_eggs::text::random_word(3)
        ))
        .await?;

    // Goose will automatically flag a 404 as an error, but in this case a 404 is
    // expected so update it as a success in the metrics.
    if let Ok(response) = &goose.response {
        if response.status() == 404 {
            user.set_success(&mut goose.request)?;
        }

    Ok(())
}

The metrics will show 0 errors when running this task, but confusingly errors still show up in the error summary at the end of the metrics, for example:

 === ERRORS ===
 ------------------------------------------------------------------------------
 Count       | Error
 ------------------------------------------------------------------------------
 16            GET 404 page: 404 Not Found: 404 page
 ------------------------------------------------------------------------------

When running set_success() the expectation is for the error to not show up in the error summary.

@LionsAd
Copy link
Collaborator

LionsAd commented Oct 20, 2021

++ - that's pretty weird :)

@jeremyandrews
Copy link
Member Author

Fixed in 0.15

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

2 participants