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

Goose hangs in the exiting phase #582

Open
lvn-ruby-dragon opened this issue Feb 13, 2024 · 0 comments
Open

Goose hangs in the exiting phase #582

lvn-ruby-dragon opened this issue Feb 13, 2024 · 0 comments

Comments

@lvn-ruby-dragon
Copy link

I have the following setup ...

pub(crate) async fn transaction1(user: &mut GooseUser) -> TransactionResult {
    user.client = Client::builder()
        .http1_only()
        .trust_dns(true)
        .build()
        .expect("Client creation failed");

    let request_builder = user
        .get_request_builder(&GooseMethod::Get, "/endpoint1")?
        .version(reqwest::Version::HTTP_11);

    let goose_request = GooseRequest::builder()
        .set_request_builder(request_builder)
        .build();

    let validation = &Validate::builder().status(200).build();

    let goose = user.request(goose_request).await?;

    validate_page(user, goose, validation).await?;

    Ok(())
}

pub(crate) async fn transaction2(user: &mut GooseUser) -> TransactionResult {
    user.client = Client::builder()
        .http1_only()
        .trust_dns(true)
        .build()
        .expect("Client creation failed");

    let request_builder = user
        .get_request_builder(&GooseMethod::Get, "/endpoint2")?
        .version(reqwest::Version::HTTP_11);

    let goose_request = GooseRequest::builder()
        .set_request_builder(request_builder)
        .build();

    let validation = &Validate::builder().status(200).build();

    let goose = user.request(goose_request).await?;

    validate_page(user, goose, validation).await?;

    Ok(())
}

pub(crate) async fn transaction3(user: &mut GooseUser) -> TransactionResult {
    user.client = Client::builder()
        .http1_only()
        .trust_dns(true)
        .build()
        .expect("Client creation failed");

    let request_builder = user
        .get_request_builder(&GooseMethod::Get, "/endpoint3")?
        .version(reqwest::Version::HTTP_11);

    let goose_request = GooseRequest::builder()
        .set_request_builder(request_builder)
        .build();

    let validation = &Validate::builder().status(200).build();

    let goose = user.request(goose_request).await?;

    validate_page(user, goose, validation).await?;

    Ok(())
}

#[tokio::main]
async fn main() -> Result<(), GooseError> {
    GooseAttack::initialize()?
        .register_scenario(
            scenario!("scenario1").register_transaction(transaction!(transaction1).set_name("tx1")),
        )
        .register_scenario(
            scenario!("scenario2")
                .register_transaction(transaction!(transaction2).set_name("tx2"))
                .register_transaction(transaction!(transaction2).set_name("tx3"))
        )
        .execute()
        .await?;

  Ok(())
}

I have 5 scenarios with a total of some 30 transactions. When I build the binary:

$ cargo build --release --target=x86_64-unknown-linux-musl

and ship the binary onto a testing machine and run it like this:

./goose-test --users 100 --startup-time 100s --host MY_HOST --report-file=report.html --run-time 2m

It successfully goes through the launching and maintain phase and then pretty much always gets stuck on exiting one of the users:

exiting user 3 from SOME_SCENARIO...

Never finishes and never produces the report. Do you see anything I'm doing wrong, please?

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