The conventional wisdom is that capital flows between developing countries and developed countries are more volatile than can be justified by fundamentals. In this paper we construct a simple model in which frictions in international financial markets in combination with standard debt-default problems lead to volatile capital flows. These flows act as tests of fire for borrowing countries. If a country survives this test, its reputation is enhanced and future capital flows become less volatile. Failing this test is associated with a loss of reputation and a decline in the amount of capital flows.