Some Long Island Rail Road customers on the Montauk line should prepare for a longer commute on buses instead of trains on Wednesday and Thursday, the MTA said.

Metropolitan Transportation Authority officials are closing a section of the track between Speonk and Montauk to perform track testing Wednesday. Off-peak trains will be replaced by bus service from 6:49 a.m. to 6:15 p.m. that day.

Officials said customers should allow for extra travel time, up to 28 minutes depending on the destination.

The testing is intended to detect internal defects to the rail, officials said. A specialized diagnostic car with ultrasonic and induction equipment will look for the defects and crews will then repair the damage.

advertisement | advertise on newsday

“The continued safety of our rails is of utmost importance to the LIRR, and this specialized ultrasonic rail testing is an important component of our efforts to keep our tracks safe,” said LIRR President Patrick Nowakowski in a statement.

Similar work is also expected Thursday between Bay Shore and Patchogue, with buses replacing two trains east from Babylon at 9:26 a.m. and 10:27 a.m., and three west from Patchogue at 9:25 a.m., 10:25 a.m. and 11:25 a.m.