I'm trying to diagnose some fun test failures rela...
# development
f
I'm trying to diagnose some fun test failures related to the nodejs backend, my current theory is that something is sharing a cache key across different pants versions (we test our plugin against multiple pants versions), causing the tests to break. Fully removing the cache and running with no parallelism does get them to pass. I noticed in the go backend theres an env var that is added to the env of all go sdk processes
__PANTS_GO_SDK_CACHE_KEY
but I don't see something similar in the nodejs backend. Would it make sense to add something like that?
h
It could make sense, but that is just band-aiding over what appears to be a real problem?
f
Possibly. I need to find some time to dig deeper into this. If you have tips on getting the sandboxes to preserve while testing pants using pants (this is in a plugin codebase) that'd be helpful
h
--keep-sandboxes=always
?
f
Figured out my sandbox issue. Its more complicated for plugin dev because of pants testing pants. You need to pass
preserve_tmpdirs=True
when constructing the RuleRunner
Copy code
rule_runner = RuleRunner(
  preserve_tmpdirs=True,
  ...
)
Passing
--keep-sandboxes=always
into
rule_runner.set_options
doesn't work. Same with passing that from the console when invoking the tests
h
I would think you would have to pass
--keep-sandboxes
into the inner pants somehow, as well as setting preserve_tmpdirs?
f