Adding tests for wait_master method