Merge branch 'fix-test_unit-railtie'

This branch is composed of #10629 and #10708

Closes #10629
Closes #10708
Fixes #10628