add tests for persistent mode