Remove transaction from test search::tests::search for CI

This commit is contained in:
Kitaiti Makoto 2021-01-13 21:58:25 +09:00
parent 6dd730030d
commit c3c8f6804b

View File

@ -114,9 +114,6 @@ mod tests {
let conn = db_pool.clone().get().unwrap();
let title = random_hex()[..8].to_owned();
let mut post_id = 0;
let (instance, user, blog, post) = &conn
.transaction::<(Instance, User, Blog, Post), diesel::result::Error, _>(|| {
let (instance, user, blog) = fill_database(&conn);
let author = &blog.list_authors(&conn).unwrap()[0];
@ -145,11 +142,7 @@ mod tests {
},
)
.unwrap();
post_id = post.id;
Ok((instance, user, blog, post))
})
.unwrap();
let post_id = post.id;
// Wait for searcher on another thread add document asynchronously
sleep(Duration::from_millis(700));
@ -162,7 +155,7 @@ mod tests {
post.delete(&conn).unwrap();
blog.delete(&conn).unwrap();
user.delete(&conn).unwrap();
diesel::delete(instance).execute(&conn).unwrap();
diesel::delete(&instance).execute(&conn).unwrap();
}
fn fill_database(conn: &Conn) -> (Instance, User, Blog) {