> > +# helper to track job status
> > +sub track_jobs {
> > +    my ($ctime) = @_;
> > +
> > +    if (!$status) {
> > +	$status = clone(PVE::Replication::job_status());
> 
> Are these clone calls necessary? 
No - I just forgot to clone the result in $mocked_replication_config->()