WIP: Move test_mode
setting to GlobalState
#1843
Draft
test_mode
setting to GlobalState
#1843