Merge "Add locking to test_aggregates"