Skip to content

Commit

Permalink
tests/util/test_app: Use test_database.connect() for `background_jo…
Browse files Browse the repository at this point in the history
…bs` query (#8439)

This allows us to get rid of the `db_write()` fn on the `App` struct.
  • Loading branch information
Turbo87 authored Apr 10, 2024
1 parent 48ba166 commit 92ace94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tests/util/test_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ impl Drop for TestAppInner {

// Manually verify that all jobs have completed successfully
// This will catch any tests that enqueued a job but forgot to initialize the runner
let conn = &mut *self.app.db_write().unwrap();
let job_count: i64 = background_jobs::table.count().get_result(conn).unwrap();
let mut conn = self.test_database.connect();
let job_count: i64 = background_jobs::table
.count()
.get_result(&mut conn)
.unwrap();
assert_eq!(
0, job_count,
"Unprocessed or failed jobs remain in the queue"
Expand Down

0 comments on commit 92ace94

Please sign in to comment.