Very few of us are ever really tested in a crisis.

We haven’t been in charge when the cost of failure is far greater than simply getting fired and when a night’s sleep becomes an unaffordable luxury.

Neel Kashkari, announced Tuesday as the new president and chief executive of the Federal Reserve Bank of Minneapolis, has had his difficult test. He passed.

Kashkari’s moment came when he served in the Treasury Department during a chaotic period of day-to-day crisis in 2008, when no one involved could say for sure there wouldn’t be another Great Depression.

He emerged as the frontman of a thoroughly hated government bailout program known as TARP. One of the reasons he looks like such a good choice to lead our Fed bank is that, to his great credit, Kashkari always says he “owns” TARP.

It was his policy. He would do it again.

Propping up New York bankers with public money is right up there with raising taxes on retirees when it comes to political popularity. So it’s no surprise Congress later soured on TARP, formally known as the Troubled Asset Relief Program.

Congressional leaders had the good sense to know in 2008 that a massive government intervention was necessary to restore stability in the financial system. But they also apparently wanted to keep showing just how angry they were about it.

Even though TARP was just a small part of the trillions of dollars of funding, guarantees and other government support during that era, it presented a fat target. Blasting Kashkari soon became one of the few genuinely bipartisan things a deeply divided Congress did.

There’s easily enough video of Kashkari’s congressional appearances available online to see why the Wall Street Journal once reported that Kashkari was “a frequent piñata for Congress.”

Kashkari almost certainly didn’t know regular public beatings were going to be part of his job.

He started at the Treasury Department in 2006, as former Goldman Sachs Chief Executive Henry Paulson took over as Secretary of the Treasury.

Kashkari had also been working at Goldman Sachs, but he worked in California with technology companies. That’s a long way from the kind of mortgage securities packaging and trading that went on in New York and later contributed to the financial crisis.

When he surfaced in a top job in Washington, Kashkari was so completely unknown that some senior executives at Goldman Sachs in New York reportedly had their assistants try to find out who he was.

Kashkari was one of two young staffers Paulson asked to put together a plan for what to do if the financial markets completely collapsed. Their memo carried the clever title of “Break the Glass: Bank Recapitalization Plan.”

Within a few days after the September 2008 collapse of Lehman Brothers Holdings, it came time to break the glass. At the end of that very chaotic week in the financial markets, Paulson first unveiled his TARP plan.

The collapse of the New York investment banking firm Lehman was far worse than just a single firm’s bankruptcy, of course. Big institutional investors had assets held by Lehman tied up in the bankruptcy, so they immediately started pulling their assets out of other big investment firms like Morgan Stanley that suddenly looked vulnerable.

The Lehman bankruptcy also caused a big money market fund manager to announce that the net asset value of some funds had fallen to 97 cents, famously “breaking the buck,” the all but unheard-of drop in value below $1.

Investors considering all this had to conclude that the big investment banks were no longer safe places to keep assets, nor were big money market funds safe places for short-term cash.

With money now streaming out of money market funds, it seemed there soon wouldn’t be enough buyers for the short-term IOUs lots of companies used to fund their operations, called commercial paper. Now they were staring at a funding crisis.

The panic was on.

TARP got its name from the original idea of buying illiquid and toxic securities. But shortly after President George W. Bush signed it into law, the Treasury Department switched the strategy.

Instead, the Treasury would inject capital directly into banks, including the healthy ones, whether they wanted it or not. Along with other measures by the Federal Deposit Insurance Corp., this was thought to be enough to ease the panic.

TARP funds were used in several ways, but the money going into banks was essentially intended to be an investment. The books still haven’t closed on the program, but through September about $430 billion was disbursed under TARP, and $442 billion has been collected.

Critics have never been impressed.

To them it’s enough to point out that TARP didn’t really stimulate any new lending. It didn’t hold senior execs of the biggest banks accountable for any of their poor decisions that led to the financial crisis. It didn’t effectively keep them from collecting big bonuses if their businesses stabilized.

And TARP didn’t do nearly enough to help homeowners who were underwater on their mortgages to escape foreclosure.

The hard part for anybody looking back on the financial crisis response is grasping that TARP was not really intended to do any of those things. It was intended to keep a wobbly financial system upright. That’s it.

Had the financial system completely tipped over, the Great Recession would have been so much worse. So, popular or not, that’s the lesson of TARP. And it’s what Kashkari understood all along.

If some sort of financial crisis develops in the next five years, another tough-minded and pragmatic thinker in the Federal Reserve System could prove to be a good thing to have.