[test] add defer tests