create robust test system w python, fix infinite loop due to buffer error