The Bodhisatta once became an Ajívaka and practised all manner of austerities in order to test the efficiency of asceticism, enduring extremes of heat and cold. He realized his error as he lay dying, and was reborn in the deva world.
The story was told in reference to Sunakkhatta, who, having left the Order and joined Korakkhattiya, went about Vesáli, vilifying the Buddha and declaring that his doctrines did not lead to the destruction of suffering. When Sáriputta reported this to the Buddha, the Buddha declared that he had tested the efficacy of asceticism ninety kappas ago and had found it wanting. J.i.389-91.
The story is also referred to in the Cariyápitaka iii.15 as the Mahálomahamsacariyá, where it exemplifies the practice of upekkhá. J.i.47.