Merge "Update the tests to register callback first" into main