Despite long-standing theoretical interest in the evolution of cooperation, empirical data on the evolutionary dynamics of cooperative traits remain limited. Here, we investigate the evolutionary dynamics of a simple public goods cooperative trait, invertase secretion, using a long-term selection experiment in Saccharomyces cerevisiae. We show that average investment in cooperation remains essentially constant over a period of hundreds of generations in viscous populations with high relatedness. Average cooperation remains constant despite transient local selection for high and low levels of cooperation that generate dynamic social interactions. Natural populations of yeast show similar variation in social strategies, which is consistent with the existence of similar selective pressures on public goods cooperation in nature.