TOKYO—The number of novel coronavirus cases on the Diamond Princess cruise ship nearly doubled to 135, posing dilemmas for Japan as it weighs testing all of the more than 3,500 people on board.

The outbreak on the ship, docked in Yokohama south of Tokyo, has emerged as one of the most difficult virus challenges outside of China, with passengers on board increasingly anxious as the news each day gets worse.

Officials...