The Chicago Housing Authority's long and painful history of racial segregation ended at least legally Thursday, with a federal court ruling that the agency has done a good job trying to eradicate conditions that spawned a 31-year legal battle.