Nginx Test Failing: Device or resource busy

We are using Chef’s test kitchen feature to test our nginx configuration files prior to deployment. A simplified version of our testing looks like this:

  1. Run a Chef recipe that creates a resolv.conf file
template '/etc/resolv.conf' do
  source 'resolv.conf.erb'
  owner 'root'
  group 'root'
  mode '0644'
  variables node['resolver']
end
  1. Tests our nginx configuration files:
execute 'nginx_configtest' do
  command 'nginx -t'
end

Within CircleCi the following error occurs when trying to create the resolv.conf file:

Errno::EBUSY: Device or resource busy @ rb_file_s_rename - (/etc/.chef-resolv20221026-301-v32ja9.conf, /etc/resolv.conf

Interestingly, within another repo using the same resolv.conf recipe we do not receive any error. We are using the ubuntu-2004:2022.07.1 image.