Opening a FIFO blocks until a "communication peer" is connected to the FIFO as well so that the pipe is successfully established.
BTW, when creating the FIFO fails, you should output (at most) a warning and continue - there are chances that the FIFO already exists and can be reused. And maybe /root/test/test
is not the best place for this FIFO...