Torah Temimah cites Shevuos 35a.
The Sages taught: “I adjure you that when you come to know testimony for me you shall come and testify” — might they be liable? Scripture says “and he heard the voice of an oath and he is a witness or saw or knew” — one whose knowledge of the testimony preceded the oath, and not one whose oath preceded the testimony.
Knowledge of the facts must already exist at the time of the adjuration. A prospective oath about future knowledge does not create shevu’as ha-eidus liability.