fixed the issue. Will look into that further Unless you use SQLite, migrating the database for each tests is really slow. What you can do is use the DatabaseTransactions trait which starts a transaction at the beginning of the test and rolls it back at the end of the test.
I hope this helps you . I think you should probably change the running average parameter way down to like 0.01 because 0.5 means the running average is half of the last frame. This is assuming that breathing is the only motion in the frame. If there larger motions or the camera is moving you are going to need a more adaptive baseline.