Fix #10701 & 10838
regression test for Issue 10701

- The test isn't 100% reliable because it depends
  on the GC and array append cache state.