A glitch during a year 2000 computer test caused a large Los Angeles water treatment facility to spill 4 million gallons of raw sewage into a city park on Wednesday night.

Although maintenance workers had vacuumed most of the sewage by early yesterday morning, the incident serves as an example of the unforeseen problems that can occur as many organizations run their computer systems through elaborate simulations to prepare for 2000.

The problem began when technicians at the Tillman Water Reclamation Plant in Van Nuys conducted a drill to see how the facility's computers and other electronic systems would respond to a Y2K-related power failure. An emergency generator kicked in as planned, but a computer failed to open an "effluent gate" that controls the flow of sewage into the plant, said Cora Jackson Fossett, spokeswoman for the city's Public Works Department.

The failure to open the gate, which was not immediately apparent to plant operators, caused sewage to back up and spill out of a manhole near the plant. The waste water flowed into Woodley Avenue and then into nearby Woodley Park.

The Los Angeles Public Health Department yesterday ordered the park closed for two or three days, spokesman Jack Petralia said.

Public works officials are investigating the incident, Fossett said.

Technology specialists said such incidents could become more frequent as businesses and government agencies conduct Y2K drills to ensure that computers that use a two-digit date system will understand the year "00" as 2000 and not 1900. The tests involve not just rolling the computers' clocks forward to Jan. 1, but often include simulating power outages and telephone failures as well as the manual operation of devices.

In March, a critical computer monitoring system at a nuclear power plant in Peach Bottom, Pa., crashed when technicians tried to turn the system's clock forward to Jan. 1, 2000. The glitch caused computer screens in the plant's control room to black out, forcing operators to rely on analog gauges.

Industry experts say it is preferable to identify and fix any problems now, even if they result in disruptions, rather than having them occur all at once on Jan. 1. "If it had to happen, we're glad it was now and not in January," Fossett said.