Fix cloudwatch test to be more robust.