"If You will surely see the affliction of Your handmaid" (1 Samuel 1:11). Rabbi Elazar said: Hannah said before the Holy One, blessed be He: If You see, well and good; but if not, You will see [either way]. I will go and seclude myself in the presence of Elkanah my husband, and once I have secluded myself he will make me drink the waters of the suspected adulteress — and far be it that You should make Your own Torah a falsehood, for it is said, "and she shall be cleared and shall conceive seed" (Numbers 5:28). This works out well according to Rabbi Shimon, who said that if she was barren she would be remembered [with children]; but according to Rabbi [Yehuda the Prince], who said that if she had borne with pain she would bear with ease, if she bore short-lived ones she would bear long-lived, if dark she would bear fair, if one she would bear two — what is "if You will surely see"? The Torah spoke in the language of human beings. Another interpretation: "If You will surely see" — see in my affliction, see in my conception, see in my giving birth.
Hannah's Threat to Drink the Waters If God Will Not See
Yalkut Shimoni on Nach 78:8
אם ראה תראה בעני אמתך וגו'. אמר ר' אלעזר אמרה חנה לפני הקב"ה אם ראה מוטב ואם לאו תראה, אלך ואסתתר בפני אלקנה בעלי ומשקה לי מי סוטנ ח"ו שאתה עושה תורתך פלסתר שנאמר ונקתה ונזרעה זרא. הניחא לר' שמעון דאמר שאם היתה עקרה נפקדת אלא לרבי דאמר אם היתה יולדת בצער יולדת בריוח קצרים יולדת ארוכים שהורים יולדת לבנים אחד יולדת שנים מאי אם ראה תראה דברה תורה כלשון בני אדם. ד"א אם ראה בצערי תראה בעיבורי תראה בלידתי: