Motivated by the recent opening of a public stool bank that enables fecal microbiota transplantation for the treatment of Clostridium difficile infection, we develop and optimize a mathematical model that tracks the flow of stools from donation to sales. To prevent the spread of infectious diseases, donors are periodically tested and donated stools are not released for sale until a donor passes a subsequent test; donors and their recently donated stools are permanently ejected from the system after a failed test. We choose the testing frequency and a policy for introducing new donors into the system to minimize the long-run expected average costs due to paying donors, processing and testing stools, and holding and backordering finished goods inventory. This problem is a variant of a continuous review inventory problem where items (i.e., donors) are continuously producing product and are failure-prone, and lead times are controllable. Instead of using approximate dynamic programming to deal with the unwieldy size of the state space, we apply heavy traffic results for multiclass infinite-server queues to approximately optimize within a specified class of base-stock policies, which maintains the expected inventory position at a constant level. This policy outperforms a policy that maintains a constant number of donors.