Please let me know if any of this is incorrect, thanks.
For the test, there are 3 transactions: parent -> child -> grand child, the peer only sends grand child to node, and then sends a block of (parent, child, grand child) to node, resulting in removing of grand child in the orphan pool.
If the block has only (child, grand child) instead, the test fails as expected, because grand child is still considered an orphan.
block_A.vtx.extend([tx_withhold_until_block_A, tx_orphan_include_by_block_A])
But I don't understand why sending a block of (parent, child) also fails the test? As grand child now receives child and parent in the new block, it can be verified and removed from orphan pool?
block_A.vtx.extend([tx_withhold, tx_withhold_until_block_A])