Move test startup logic so db is ready too