"Found dependency on %s/%s",
k->unit->id, job_type_to_string(k->type));
- if (!delete &&
+ if (!delete && hashmap_get(tr->jobs, k->unit) &&
!unit_matters_to_anchor(k->unit, k)) {
/* Ok, we can drop this one, so let's
* do so. */
}
if (type != JOB_STOP && unit->load_state == UNIT_ERROR) {
- if (unit->load_error == -ENOENT)
+ if (unit->load_error == -ENOENT || unit->manager->test_run)
sd_bus_error_setf(e, BUS_ERROR_LOAD_FAILED,
"Unit %s failed to load: %s.",
unit->id,