fix TestDataGenerator's buffer refilling issue