facebook / akd

An implementation of an auditable key directory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix faulty azks polling test

afterdusk opened this issue · comments

commented

The following test is intended to assert that AZKS polling produces a correct view of the tree for a reader in the presence of a concurrent writer and independent caches.

https://github.com/novifinancial/akd/blob/97b2e90589083fef4600f732618715fac29a24f2/akd/src/tests.rs#L596-L655

However, the in-memory DB used (AsyncInMemoryDatabase) does not have a cache. AsyncInMemoryDbWithCache should be used instead. That being said, a simple substitution to AsyncInMemoryDbWithCache would not work as the cache is managed by the DB. Both the reader and writer would need to share a cache to access the same in-memory DB.

A fix would be to port over this test to the integration_tests crate and use a AsyncMySqlDatabase. Both the reader and writer can initialize separate DB clients with independent caches connected to the same DB.