Distributed is in stdlib, but preventing precompilation via being missing?

stdlibs still need to be added to a package’s environment/Project.toml. It’s not a problem running interactively in the REPL because of the way Julia stacks environments, but that global environment isn’t available inside of the module.

So you need to ]add Distributed from within the TestMod environment.