Skip to content

Commit 8d08005

Browse files
committed
sentry - middleware - auth - call FLUSHALL to clean previous test runs data from Redis
1 parent 744d539 commit 8d08005

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sentry/src/middleware/auth.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ mod test {
105105
dummy_auth_tokens: AUTH.clone(),
106106
};
107107
let config = configuration("development", None).expect("Dev config should be available");
108-
let redis = redis_connection().await.expect("Couldn't connect to Redis");
108+
let mut redis = redis_connection().await.expect("Couldn't connect to Redis");
109+
// run `FLUSHALL` to clean any leftovers of other tests
110+
let _ = redis::cmd("FLUSHALL").query_async::<_, String>(&mut redis).await;
109111
(DummyAdapter::init(adapter_options, &config), redis)
110112
}
111113

@@ -132,7 +134,7 @@ mod test {
132134
Err(ResponseError::BadRequest(error)) => {
133135
assert!(error.to_string().contains("no session token for this auth: wrong-token"), "Wrong error received");
134136
},
135-
Ok(_)|Err(_) => panic!("We shouldn't get a success response nor a different Error than BadRequest for this call"),
137+
_ => panic!("We shouldn't get a success response nor a different Error than BadRequest for this call"),
136138
};
137139
}
138140
}

0 commit comments

Comments
 (0)