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

Unable to generate report with transactions without http requests #545

Closed
AlexXi19 opened this issue May 8, 2023 · 1 comment · Fixed by #555
Closed

Unable to generate report with transactions without http requests #545

AlexXi19 opened this issue May 8, 2023 · 1 comment · Fixed by #555

Comments

@AlexXi19
Copy link

AlexXi19 commented May 8, 2023

I'm trying to create some loadtests without using the goose user's http client but instead use my own client. However, when I try this, I'm able to see the metrics in the CLI, but the application panics on exit, which I'm guessing is from generating the report. I was able to generate a report correctly when I use the user to send http requests.

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /Users/alexxi/.cargo/registry/src/github.com-1ecc6299db9ec823/goose-0.17.0/src/graph.rs:425:41
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#[tokio::main]
async fn main() -> Result<()> {
    GooseAttack::initialize()?
        .set_default(GooseDefault::Host, "http://localhost:5000")?
        .set_default(GooseDefault::ReportFile, "report.html")?
        .set_default(GooseDefault::Users, 1)?
        .set_default(GooseDefault::Iterations, 10)?
        .set_default(GooseDefault::RunTime, 5)?
        .register_scenario(
            scenario!("TestScenario")
                .register_transaction(transaction!(loadtest_index))
        )
        .execute()
        .await?;

    Ok(())
}

async fn loadtest_index(user: &mut GooseUser) -> TransactionResult {
    // Tokio sleep for 1 second
    tokio::time::sleep(std::time::Duration::from_secs(1)).await;
    Ok(())
}
@jeremyandrews
Copy link
Member

You've hit the same bug as reported in #533 -- we've got a bad assumption in the code here that needs to be fixed.

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

Successfully merging a pull request may close this issue.

2 participants