The test assumes that the kernel buffer for pipes have fixed size.
It does not have to be true, there could be adaptive buffer size
provided by kernel. After filling whole kernel buffer (by non-blocking
write), it might be required to buffer becomes filled only from half
or even empty. The next write() might be blocked until whole
kernel buffer is read. Such behaviour of kernel is correct one.