Fix concurrency bug while testing

This commit is contained in:
2022-01-17 17:09:54 +01:00
parent f44a2958c1
commit 267cdb89c6
9 changed files with 67 additions and 44 deletions

View File

@@ -1,12 +1,12 @@
pub mod test_helper;
use rstest::*;
use test_helper::app_address;
#[rstest]
#[tokio::test]
async fn health_check_works() {
let address = test_helper::spawn_app();
let client = reqwest::Client::new();
let response = client
.get(&format!("{}/ping", &address))
async fn health_check_works(app_address: &str) {
let response = reqwest::Client::new()
.get(&format!("{}/ping", &app_address))
.send()
.await
.expect("Failed to execute request.");