Revert "Merge pull request #2167 from AndrejMitrovic/Fix10341"

This reverts commit 384d833208c0b75de66c932fb2c78f70bdf6c902, reversing
changes made to af70ceb79ecae10a3b268886580cf3952fb21ab9.

-----

Currently auto-tester has random failures in Linux platform. From the circumstance, this change is the most doubtful. So I revert it conservatively.