Refactor set_stream_test