Make test server module-able
Define callback that uses nonlocal variable