When you test your water peramiters once daily sometimes twice just to be sure the water conditions are great.
Seeing 40 ppm
on a nitrate test for fresh water or 20ppm for salt water is grounds for an immediate water change. Even 15 ppm
on salt water is iffy about waiting another day.