-
-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Pantsd] Enable pantsd in Travis #7320
Comments
Iterating on #7322. |
Will gather a log today of issues, and triage them based on whether I think that they will be fixed by #7341. |
Is there a ticket or comment somewhere describing the blockers to using pantsd run-over-run for integration tests in travis? I am vaguely aware that the integration tests are supposed to have a separate buildroot, which means pantsd can't immediately be used. There is even a specific warning when using pantsd in an integration test: pants/src/python/pants/pantsd/pants_daemon.py Lines 189 to 198 in ecd1554
Is there a reason we can't share that across runs? The time we get back in our lives from having integration tests run faster is going to make everything else easier to iterate on. If this is considered an unnecessary addendum to the pantsd work right now then I can work on it myself, but I'd appreciate having the blockers more clearly laid out. |
@cosmicexplorer : All integration tests use new anonymous workdirs, intentionally, to avoid mixing of results from one test method into another. This is mostly because having to worry about state from other tests being mixed into your current test method would drive you fairly quickly insane. I think that we need to build a huge amount of trust in pantsd before we begin to do that. We could begin collecting blockers into an issue, but I know of 3 or 4 off the top of my head (which we may or may not fix while enabling pantsd by default... unclear), so it doesn't feel like a priority to me. EDIT: But, if you are interested in pushing on it, I would recommend making it a separate ticket blocked by this one. |
I've updated the description with a summary of failures from #7322. In short... there aren't that many? And it doesn't seem like any of them would be fixed by #7341 (with the exception of maybe the watchman-related failures). I don't think that that means we shouldn't implement and use #7341, but it might affect the priority. |
Unassigning for now so that I can work on the release. |
Will pick this back up later today. |
I've added and applied a decorator to the tests mentioned above in #7322: so it should go mostly-green. |
Still looking at a few more failures here. |
This is being continued in #7440. |
** Problem ** See #7320 for context. We would like to run integration tests under pantsd, to discover more issues. ** Solution ** Enable pantsd in the integration tests in the cron shard for py36 (not in the test runner, but on individual integration tests themselves) via a class property, and blacklist the tests that don't work with a useful docstring. ** Result ** Pantsd will now be enabled in integration and contrib tests running in the cron py36 shards.
Closed with #7440 |
In the context of #4438, a large step will be enabling pantsd in Travis CI. This ticket is created to track progress towards that.
An unordered summary of known issues discovered in #7322:
Forking issues
no_proxy
not set #7380) "dynamically adding to--pythonpath
does not affect a forked pantsd instance" ?:tests/python/pants_test/backend/python:integration
(have seen it be flaky in other places) https://gist.github.com/stuhood/2d87abf9d08df80c9062ffcb93cff393:
tests/python/pants_test/backend/python/tasks/native:integration
https://gist.github.com/stuhood/a2a927816f7d7712278b454949778d15
tests/python/pants_test/backend/project_info/tasks:idea_plugin_integration
"test directly inspecting value of the
ENABLE_PANTSD
option":tests/python/pants_test/goal:run_tracker_integration
"not necessarily broken, just expecting log output". When exceptions are logged to files as opposed to stderr, and tests check for some string in stderr, that's a problem:
tests/python/pants_test/logging:test_native_engine_logging
tests/python/pants_test/rules:test_integration
tests/python/pants_test/engine/legacy:pants_engine_integration
tests/python/pants_test/engine/legacy:graph_integration
tests/python/pants_test/build_graph:build_graph_integration
TestPantsDaemonIntegration.test_pantsd_sigterm
pants.pantsd.watchman.Watchman.WatchmanCrash: error from watchman: RootResolveError: unable to resolve root /home/travis/build/pantsbuild/pants/.pants.d/tmp/$snip.pants.d: directory /home/travis/build/pantsbuild/pants/.pants.d/tmp/$snip.pants.d is not watched -> This presents the case where problems arise if tests create their own buildroots I don't think that's something we should deal with in production, for now? Not sure though.
tests/python/pants_test/backend/jvm/tasks/jvm_compile/java:cache_compile_integration
tests/python/pants_test/backend/python/tasks:integration
When
hermetic
is enabled inPantsDaemonIntegrationTestBase
, many of the pantsd tests complain about absolute symlinks on in the python distribution:Exception: Failed to read_link for Link("build-support/pants_dev_deps.py37.venv/.Python"): Custom { kind: InvalidData, error: StringError("Absolute symlink: \"/Users/bescobar/workspace/otherpants/build-support/pants_dev_deps.py37.venv/.Python\"") }
, or because some plugins are not loaded. I think this is because of the--pants-config-files=[]
that is passed when hermetic. To this point, the reason things had to be hermetic in the first place was because some tests run pantsd multiple times, and expect it to be alive between runs in the same test. Since thePANTS_SHUTDOWN_PANTSD_AFTER_RUN
option leaked from the travis env, every pants run in the test shut down the daemon. Stripping that option should be enough to make those tests run non-hermetically, I think.tests/python/pants_test/pantsd:pantsd_integration
test_pantsd_compile
test_pantsd_run
test_pantsd_filesystem_invalidation
test_pantsd_aligned_output
tests/python/pants_test/engine/legacy:console_rule_integration
test_v2_list
So, TL;DR, the current set of issues this has (which may or may not be relevant to enabling pantsd itself). Barring these, travis passes (ticked means "probably not relevant outside of the test harness"):
PANTS_SHUTDOWN_PANTSD_AFTER_RUN=true
was leaking from the travis env. There are tests that expect the daemon to be alive run after run, because they test things like FS invalidation. Even though we turned the CLI option off in the pantsd running context, the ENV var still leaked. That meant that pantsd got restarted after every run within the test. This problem is both not very relevant because it only affects the test harness, and not very hard to solve for the test harness.logs/exceptions.log
, and doesn't reach stderr. I have to investigate more to see if this is an error that actually happens in the wild.mock_buildroot()
actually symlinks the inner.pants.d
directory to the outer one (something like.pants.d/tmpabc123/.pants.d -> .pants.d
). Therefore, when we run the test wit the daemon enabled, and we try to watch the workdir (.pants.d/tmpabc123/.pants.d
), watchman will crash because it doesn't support symlinks. If this is the case, this means that the issues is in the test harness, not pantsd (except maybe we could give a more graceful error if we fail because of this).mock_buildroot()
, we link some essential files to basically recreate a minimal buildroot. We don't link a file called.python_interpreter_constraints
. This means that, when the test runs pants in the current buildroot, it sees that the python interpreter constraints file is missing, and triggers a./pants clean-all
, which in turn gets rid of the symlink of.pants.d/tmpabc123/.pants.d -> .pants.d
, and replaces it with a new folder. I'm not sure what the connection is between this and watchman crashing, but if we also link the.python_interpreter_constraints
file, it works.The text was updated successfully, but these errors were encountered: