(Whitney Shefte,Rhonda Colvin,Malcolm Cook,Bastien Inzaurralde/The Washington Post)

Senate Majority Leader Mitch McConnell (R-Ky.) has occasionally remarked that he has an unusual relationship with President Trump: Unlike most congressional leaders, he has managed to escape Trump’s wrath.

“He’s never, as far as I can tell, gotten angry at me — in my presence, anyway,” McConnell said last month.

That fragile peace between a taciturn insider and a brash newcomer, which has helped both men pursue Republican priorities, faced a fresh and consequential test this week, when a major rewrite of the nation’s health-care legislation faltered in the Senate.

McConnell has largely taken responsibility for ushering the GOP overhaul of the Affordable Care Act through the Senate. The bill suffered a blow on Tuesday, when a procedural vote was postponed until next month because at least half a dozen Republican senators remain wary of the measure. The cost of the fumble could be not only fury from the party’s conservative base, but deeper questions about the durability of the McConnell-Trump alliance.

The partnership appeared intact at the White House, where McConnell and his Republican colleagues joined Trump on Tuesday afternoon to project optimism that a health-care overhaul is not dead.

(Monica Akhtar/The Washington Post)

“Everybody around the table is interested in getting to yes, interested in getting an outcome,” McConnell told reporters outside the West Wing. “Because we know the status quo is simply unacceptable, unsustainable, and no action is just not an option.”

In the meeting with senators, Trump said negotiators were “getting very close.”

“This will be great if we get it done. And if we don’t get it done, it’s just going to be something that we’re not going to like,” Trump said. “And that’s okay. I understand that very well.”

McConnell and Trump remain hungry for a win. But their understanding, built to score legislative victories, does neither of them any good if victories remain out of reach. With the health-care bill facing its latest setback, members of both parties are watching the dynamic between McConnell and Trump for a sign of what’s to come.

“Trump can be impatient,” former House speaker Newt Gingrich (R-Ga.) said in an interview. “He may well want to raise the heat on the institution of the Senate.”

But, he added, “The way our Constitution is written, he and Mitch will need each other in the end.”

The Republican-led Congress has a daunting set of ambitions and challenges this summer that will demand a strong relationship between the two men: overhauling the tax code, confronting a debt ceiling and passing a federal budget. The increasingly fraught push in recent days to pass the health-care bill has come with those goals on the horizon, said multiple Republicans familiar with the discussions.

On its surface, the health-care effort is about fulfilling a GOP pledge. But Republicans said it is also a test of whether McConnell and Trump can stitch together winning coalitions on any big-ticket item this year — and reassure business leaders and activists eager for action.

Troubling Republicans amid the talks is the unpopularity of their pursuit. Support for the Affordable Care Act has increased in polls this year, while the Republican bill has consistently proven to be unpopular. Several GOP operatives have privately said that failure would not be a total disaster for the party, because no one loves the bill, and moderates could avoid being burdened by it.

Trump and McConnell have plowed forward, arguing to members that repeal is a signature GOP promise and the foundation for the reforms that Republicans want to enact.

But they have done so on parallel tracks, without many joint appearances or instances of a rapport, at least until Tuesday. Their antipathy for Democrats and desire to win, rather than ideology or a personal connection, is what unites them, those close to them say.

The tenor of Trump’s bond with McConnell contrasts with the president’s relationship with House Speaker Paul D. Ryan (R-Wis.), said two White House officials who spoke on the condition of anonymity. Whereas Trump and Ryan have clashed in the past yet have shown flashes of friendliness, McConnell, 75, and Trump, 71, are transactional peers.

“Trump really believes that he can make relationships swing people his way. But he’s figured out that’s not the way McConnell works, so there isn’t much schmoozing going on,” longtime Republican strategist Vin Weber said. “It’s a realistic situation. Trump isn’t going to schmooze, and McConnell won’t blow smoke. That’s led to a relationship that has respect, though it’s not warm.”

Trump and McConnell are voracious consumers of news and information, especially cable news. But their habits diverge. Trump gets his news printed out on paper, while McConnell often reads news on his iPad. Trump is a keen watcher of cable news shows in the morning and in prime time, whereas McConnell sets his evening schedule around watching Bret Baier’s evening report on Fox News Channel.

Trump’s role on the health-care bill has mostly been an encouraging voice over phone calls and cheerleader in chief on Twitter, bucking up Republicans and skewering Democrats, while McConnell works his members and mulls over amendments.

“In the early stages, candidly, it’s been kind of a waste of his time,” McConnell told reporters Tuesday, explaining Trump’s more hands-off approach in the health-care process. “We needed to get this far enough down the path.”

Both men have relied heavily on Vice President Pence, who has held meetings, including a dinner this week, with individuals about the legislation,.

One development took McConnell’s orbit by surprise — and raised the specter of a souring of relations between the White House and the Senate majority leader. A Trump-allied Republican super PAC announced plans for a seven-figure advertising campaign in Nevada to push Sen. Dean Heller, a moderate Republican, to vote for the bill.

McConnell made clear in a call with White House Chief of Staff Reince Priebus over the weekend that he thought the ad blitz was “stupid,” said two Republicans familiar with the group, because it put public pressure on one of his most vulnerable members. On Tuesday, after a White House meeting with McConnell, Trump and other GOP senators, the super PAC indicated that it would pull the ads, said several Republicans familiar with the deliberations.

The majority leader has leaned on Trump to use his influence on the right. Several Republicans said Sen. Ted Cruz (R-Tex.), for example, was viewed as someone Trump could sway. Cruz is up for reelection next year in a conservative state where crossing the president could be a problem.

“He’s having some phone calls with people, but nothing too specific right now,” Sen. John Cornyn (Tex.), the GOP whip, said earlier in the week.

Trump also called Sen. Rand Paul (R-Ky.) on Monday, said Paul spokesman Sergio Gor. The president phoned Cruz last week. Neither senator supports the draft that McConnell released, nor does fellow conservative Sen. Mike Lee (R-Utah), who also has been called by Trump.

“We always anticipated the president would be very important in getting us to a conclusion. After all, under our system, he’s the man with the signature,” McConnell said Tuesday. “He’s fully engaged and being helpful in every way that he can, including the meeting this afternoon,” when Trump invited GOP senators to the White House.

Trump associates are cautiously confident that McConnell will eventually secure the necessary votes when the Senate returns from its July 4 recess. He was central in shepherding Trump’s most notable victory — the confirmation of Supreme Court Justice Neil M. Gorsuch — and that experience in particular, they said, forged their trust.

“Mitch understands Congress a lot better than Trump does,” said Barry Bennett, a former Trump campaign adviser. “He’s a pro. It helps that McConnell has never said a bad thing about Trump publicly.”

Beyond GOP unease, there have been other roadblocks. The bill’s fate took another turn on Monday, when the Congressional Budget Office released an analysis concluding that the Senate bill would cause an estimated 22 million more Americans to be uninsured in the coming decade — about 1 million fewer than similar legislation passed by the House.

The undertaking has revealed the contours of the McConnell-Trump rapport as much as it has Republican tensions.

Since Trump’s inauguration, McConnell has not shied away from candid pronouncements about the president. He has urged him to focus on the agenda the GOP campaigned on in 2016, and he has repeatedly said he does not like the tweets Trump often uses to wage personal attacks.

McConnell concluded early on that he was not going to change Trump’s combative ways and would have to work around them, associates said. McConnell told The Washington Post in a February interview that he has had “candid conversations” with Trump about his tweets, but they did not make a “bit of difference.”

Ed O’Keefe, Paul Kane and Abby Phillip contributed to this report.