[BACKPORT]for 1.1 update unit test to handle MemoryError #483