President Mikhail S. Gorbachev of the Soviet Union has said that ending shortages and poor distribution of consumer goods poses a critical test for his leadership. The Pepsico deal is being closely watched as an indicator of whether Western companies can prosper in the Soviet market, which has 287 million consumers who have had little to buy.

Pepsico was the first large American company to enter the Soviet market, led by its former chairman, Donald M. Kendall, who is now the chairman of the executive committee. Mr. Kendall, a former co-chairman and now a director of the U.S.-U.S.S.R. Trade and Economic Council, has actively encouraged other Western businesses to invest in the Soviet Union. He once told an interviewer, ''If we can get the Soviet people to enjoy good consumer goods, they'll never be able to do without them again.''

Pepsico, which is based in Purchase, N.Y., had sales in 1989 of more than $15 billion, making it one of the largest consumer-product companies in the world. Its brand names include the Kentucky Fried Chicken and Pizza Hut restaurants and Doritos tortilla chips.

''This deal is going to make the Soviet Union a very big business for us,'' said John Swanhaus, president of Pepsico's Wines and Spirits subsidiary. Pepsi consumption in the Soviet Union is small - currently about 40 million cases, or about the annual consumption of the Orlando, Fla., metropolitan area, with a population of about one million people. (That does not include nearby Disney World, where, in any case, the Coca-Cola Company has an exclusive concession.) Pepsi sells in the Soviet Union for the equivalent of 75 cents for an 11-ounce bottle.

Limited by Infrastructure

Although bottling plants are running at full capacity, Mr. Swanhaus said Pepsi's business was limited by such basic considerations as poor roads and the availabilty of trucks. ''There is no infrastructure in place if tomorrow you triple your business,'' he added.