Most of the database tests assume that they can use the entire database quota, but none of them clean up when they exit, so that's not a valid assumption. In particular the database tests that try to allocate the entire 5MB [in some cases twice!] only pass because of lucky timing. Each test should start out by cleaning up any existing databases before doing anything.