Skip to content

Commit d78dbb4

Browse files
client/dbus: Fix test race condition
As the tests run in //, a test can create an item when the other checks for the item removal which would cause a failure. Instead just ensure the item with attributes is no longer there.
1 parent bc61783 commit d78dbb4

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

client/src/dbus/collection.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ mod tests {
272272
let secret = crate::Secret::text("a password");
273273

274274
let collection = service.default_collection().await.unwrap();
275-
let n_items = collection.items().await.unwrap().len();
276275
let n_search_items = collection.search_items(&attributes).await.unwrap().len();
277276

278277
let item = collection
@@ -283,15 +282,13 @@ mod tests {
283282
assert_eq!(item.secret().await.unwrap(), secret);
284283
assert_eq!(item.attributes().await.unwrap()["type"], value);
285284

286-
assert_eq!(collection.items().await.unwrap().len(), n_items + 1);
287285
assert_eq!(
288286
collection.search_items(&attributes).await.unwrap().len(),
289287
n_search_items + 1
290288
);
291289

292290
item.delete(None).await.unwrap();
293291

294-
assert_eq!(collection.items().await.unwrap().len(), n_items);
295292
assert_eq!(
296293
collection.search_items(&attributes).await.unwrap().len(),
297294
n_search_items

0 commit comments

Comments
 (0)