Is having a sudden lack of eman a sign of Allah Testing you?

Not necessary. It could mean that you are drifting away, lack of engagement in acts of worship, losing interest. It could mean anything but it’s definitely a sign to re connect with Allah