Add test for metadata service bug fix