I know this is just for the test database, but are you sure there are no other users of the database at the time this command is run?  It could easily lock the whole database.