In July, Boeing (NYSE:BA) investors got some unwelcome news, as the company said it would book an $835 million pre-tax charge related to the development of the KC-46 Pegasus aerial refueling tanker. Problems with the fuel system necessitated a redesign and retrofit program. Since Boeing agreed to a capped-price contract with the Air Force, it is responsible for cost overruns.

This was the second special charge Boeing has taken with respect to this contract. That's caused concern from some analysts that the KC-46 Pegasus could turn into a big money pit for Boeing, because of its aggressive bid.

Fortunately, the project appears to be getting back on track. Late last month, Boeing finally completed an initial four hour test flight for the first KC-46 tanker. There is plenty of testing left to do -- not to mention putting the plane into full production -- but Boeing still has a chance to salvage the KC-46 program and turn a decent profit.

A small step forward
The initial flight conducted last month checked the plane's basic systems. According to the company, "Boeing test pilots performed operational checks on engines, flight controls and environmental systems and took the tanker to a maximum altitude of 35,000 feet prior to landing."

The KC-46 Pegasus finally got off the ground on Sept. 25. Photo: Boeing.

The plane performed as expected. The actual refueling equipment -- the most complicated part of the plane -- was not part of the test, making it a relatively small victory. That said, Boeing had originally planned to test the KC-46 Pegasus in August, but mechanics accidentally damaged the fuel system by using a mislabeled chemical for a preliminary test. So just getting off the ground was an accomplishment.

Boeing still expects to be able to test the refueling system and then do aerial refueling trial runs before the end of the year. If those tests are successful, then Boeing will be in good shape to avoid taking any more big special charges for cost overruns.

Risks are real, but manageable
The KC-46 program does carry some real risks for Boeing. The company has committed to delivering an initial batch of 18 tankers to the Air Force by August 2017. However, delays in the development process pushed back the Air Force's final decision on whether to go ahead with the order until April 2016. To gain this approval, Boeing needs to demonstrate that the KC-46 Pegasus meets all of its requirements.

However, Boeing can't wait until next April to start production, or else it wouldn't have the initial batch of planes ready in time. Thus, it is producing planes without a guarantee that the Air Force will be satisfied.

The likelihood that the Air Force will leave Boeing in the lurch seems relatively low, though. Obviously, if Boeing is hit with a big setback with no obvious fix, the Air Force could reconsider, but it really needs this plane. The KC-135 Stratotankers being replaced are already 50 to 60 years old, and the procurement process for new aircraft takes years.

It's harder to measure the likelihood of further major development snags. However, the Air Force general in charge of the program has said he is "cautiously confident" and that the biggest issues at this point are schedule-related and not performance-related.

Meaningful upside
Today, many investors appear to view the KC-46 program as a potential liability for Boeing. However, there is also a lot of upside if Boeing can just avoid big mishaps. The company is already in line to get more than $40 billion for the 179 tankers the Air Force wants. The total market opportunity could be double that amount, though, as Boeing will be able to market the KC-46 to foreign militaries.

That's a lot of potential future revenue relative to the extent of Boeing's cost overruns thus far. It's way too early for Boeing investors to write off the KC-46 as a lost cause.

Adam Levine-Weinberg owns shares of The Boeing Company. The Motley Fool has no position in any of the stocks mentioned. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.