Skip to content

Commit

Permalink
Attempt fix flake
Browse files Browse the repository at this point in the history
This test is flaky around the fifth run for some reason. My
guess is because another cleanup process is interfering, which
seems strange but not impossible. Anyway, moving the content-existence
check to _before_ changing its expiration seems to fix the issue.
  • Loading branch information
jaymell authored and svix-james committed Oct 4, 2024
1 parent d5d90f1 commit ec61c65
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions server/svix-server/tests/it/e2e_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,12 @@ async fn test_payload_retention_period() {
.unwrap();
let msg_id = msg.id.clone();

let content: Option<messagecontent::Model> = messagecontent::Entity::find_by_id(msg_id.clone())
.one(&pool)
.await
.unwrap();
assert_eq!(content.unwrap().id, msg_id.clone());

let res = messagecontent::Entity::update_many()
.col_expr(
messagecontent::Column::Expiration,
Expand All @@ -406,12 +412,6 @@ async fn test_payload_retention_period() {
.unwrap();
assert_eq!(1, res.rows_affected);

let content: Option<messagecontent::Model> = messagecontent::Entity::find_by_id(msg_id.clone())
.one(&pool)
.await
.unwrap();
assert_eq!(content.unwrap().id, msg_id.clone());

expired_message_cleaner::clean_expired_messages(&pool, 5000, false)
.await
.unwrap();
Expand Down

0 comments on commit ec61c65

Please sign in to comment.