"attempt to write a readonly database" with BrowserTestBase Functional tests
I don't quite understand why this fixes the problem, but in my case the issue was caused by my executing the core/scripts/run-tests.sh script as root. By running it as www-data instead the issue went away.
I can only assume that the sqlite DB gets created by root and then the script switches itself over to www-data and can't access the DB anymore.