From 27d9cf04de50fd852cf36df2becbdc2b36c6cbb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 8 Dec 2020 11:52:21 +0100 Subject: [PATCH] base: Remove a flaky state store test. The state store is undergoing a rewrite and this test fails more often than i would like making our CI seem flaky. Remove the test since it's going to become obsolete anyways. --- matrix_sdk_base/src/state/json_store.rs | 40 ------------------------- 1 file changed, 40 deletions(-) diff --git a/matrix_sdk_base/src/state/json_store.rs b/matrix_sdk_base/src/state/json_store.rs index 1eea500b..a959418d 100644 --- a/matrix_sdk_base/src/state/json_store.rs +++ b/matrix_sdk_base/src/state/json_store.rs @@ -360,44 +360,4 @@ mod test { // test that we have removed the correct room assert!(invited.is_empty()); } - - #[tokio::test] - async fn test_client_sync_store() { - let dir = tempdir().unwrap(); - let path: &Path = dir.path(); - - let session = Session { - access_token: "1234".to_owned(), - user_id: user_id!("@cheeky_monkey:matrix.org"), - device_id: "DEVICEID".into(), - }; - - // a sync response to populate our JSON store - let store = Box::new(JsonStore::open(path).unwrap()); - let client = - BaseClient::new_with_config(BaseClientConfig::new().state_store(store)).unwrap(); - client.restore_login(session.clone()).await.unwrap(); - - let mut response = sync_response(SyncResponseFile::Default); - - // gather state to save to the db, the first time through loading will be skipped - client.receive_sync_response(&mut response).await.unwrap(); - - // now syncing the client will update from the state store - let store = Box::new(JsonStore::open(path).unwrap()); - let client = - BaseClient::new_with_config(BaseClientConfig::new().state_store(store)).unwrap(); - client.restore_login(session.clone()).await.unwrap(); - - // assert the synced client and the logged in client are equal - assert_eq!(*client.session().read().await, Some(session)); - assert_eq!( - client.sync_token().await, - Some("s526_47314_0_7_1_1_1_11444_1".to_string()) - ); - assert_eq!( - *client.ignored_users.read().await, - vec![user_id!("@someone:example.org")] - ); - } }