Skip to content

Commit

Permalink
Merge pull request #539 from jeremyandrews/clippy-fixes
Browse files Browse the repository at this point in the history
document why we're not awaiting
  • Loading branch information
jeremyandrews authored May 1, 2023
2 parents a45707b + be699e5 commit 24eae0e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,9 @@ pub(crate) async fn controller_main(

// Spawn a new thread to communicate with a client. The returned JoinHandle is
// ignored as the thread simply runs until the client exits or Goose shuts down.
let _ = tokio::spawn(controller_state.accept_connections(stream));
// Don't .await the tokio::spawn or Goose can't handle multiple simultaneous
// connections.
let _ignored_joinhandle = tokio::spawn(controller_state.accept_connections(stream));
}

Ok(())
Expand Down
6 changes: 4 additions & 2 deletions tests/cancel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ async fn run_standalone_test(test_type: TestType) {
let configuration = common_build_configuration(&server, &test_type);

// Start a thread that will send a SIGINT to the running load test.
let _ = tokio::spawn(cancel_load_test(Duration::from_secs(3)));
// Don't await tokio::spawn, instead run in parallel and continue to start Goose Attakc.
let _ignored_joinhandle = tokio::spawn(cancel_load_test(Duration::from_secs(3)));

// Run the Goose Attack.
let goose_metrics = common::run_load_test(
Expand Down Expand Up @@ -333,7 +334,8 @@ async fn run_gaggle_test(test_type: TestType) {
);

// Start a thread that will send a SIGINT to the running load test.
let _ = tokio::spawn(cancel_load_test(Duration::from_secs(3)));
// Don't await tokio::spawn, instead run in parallel and continue to start Goose Attakc.
let _ignored_joinhandle = tokio::spawn(cancel_load_test(Duration::from_secs(3)));

// Run the Goose Attack.
let goose_metrics = common::run_load_test(manager_goose_attack, Some(worker_handles)).await;
Expand Down
3 changes: 0 additions & 3 deletions tests/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,6 @@ async fn test_defaults_gaggle() {
// Setup the mock endpoints needed for this test.
let mock_endpoints = setup_mock_server_endpoints(&server);

const HOST: &str = "127.0.0.1";
const PORT: usize = 9988;

let mut configuration = common::build_configuration(&server, vec![]);

// Unset options set in common.rs so set_default() is instead used.
Expand Down

0 comments on commit 24eae0e

Please sign in to comment.