fix(test): adjust defer invocations (#14996)

Commit 105ab2e95a pushed by mudhornmain

Scorecards analysis

Canceled