BEIJING—China conducted the first test flight of its stealth fighter just hours before U.S. Defense Secretary Robert Gates sat down with President Hu Jintao here to mend frayed relations, undermining the meeting and prompting questions over whether China's civilian leadership is fully in control of the increasingly powerful armed forces.

U.S. officials said President Hu appeared not to have heard of the test flight when Mr. Gates asked him about it in their meeting Tuesday, even after pictures and accounts of it had begun...