witty-crayon-22786
09/28/2020, 8:52 PMStarting
messages for test processeswitty-crayon-22786
09/28/2020, 8:52 PMwitty-crayon-22786
09/28/2020, 8:55 PMProcessResult
EngineAware
, and then silence the workunits created by the Process
itselfwitty-crayon-22786
09/28/2020, 8:57 PMEnrichedTestResult
hundreds-father-404
09/28/2020, 8:58 PMEngineAwareParameterType
might work. Set it on the PythonTestFieldSet
witty-crayon-22786
09/28/2020, 8:58 PM@rule
that produces that workunit to tell us when it has started, for two reasons: 1) it’s not under the process lock so it doesn’t know that it has actually started, 2) the @rule
won’t know its own identity when it startshundreds-father-404
09/28/2020, 8:59 PMthe @rule won’t know its own identity when it startsOh, yeah, I think
EngineAwareParameter
only impacts some things like stacktraces, but not the “Starting” messagehundreds-father-404
09/28/2020, 9:00 PMwitty-crayon-22786
09/28/2020, 9:00 PMhundreds-father-404
09/28/2020, 9:01 PMstarting_level=<http://LogLevel.INFO|LogLevel.INFO>,
ending_level=LogLevel.DEBUG,
The Process
constructor can take level
or starting_level
and ending_level
. If you only do level
, then it will automatically set the other two.witty-crayon-22786
09/28/2020, 9:02 PMwitty-crayon-22786
09/28/2020, 9:04 PMhundreds-breakfast-49010
09/28/2020, 9:06 PMhundreds-breakfast-49010
09/28/2020, 9:06 PMwitty-crayon-22786
09/28/2020, 9:06 PMhundreds-breakfast-49010
09/28/2020, 9:07 PMStarting
messages?witty-crayon-22786
09/28/2020, 9:07 PMhundreds-breakfast-49010
09/28/2020, 9:07 PMwitty-crayon-22786
09/28/2020, 9:08 PMwitty-crayon-22786
09/28/2020, 9:08 PMProcess
is marked debughundreds-father-404
09/28/2020, 9:08 PMbut this is a sticky problem, because only the Process’s workunit(s) know when it is actually runningI think that keeping the log message on the
Process
is correct. The Process
also has access to the information it needs: the file/target it’s running on
Imo, it seems like this is about a need to have the Process
be INFO at its start, but DEBUG at completionwitty-crayon-22786
09/28/2020, 9:08 PMhundreds-breakfast-49010
09/28/2020, 9:09 PMhundreds-breakfast-49010
09/28/2020, 9:09 PMhundreds-breakfast-49010
09/28/2020, 9:10 PMwitty-crayon-22786
09/28/2020, 9:10 PMEngineAwareReturnType
down far enough would allow us to actually configure completion info for the Process
?witty-crayon-22786
09/28/2020, 9:12 PMwitty-crayon-22786
09/28/2020, 9:12 PMhundreds-breakfast-49010
09/28/2020, 9:13 PMhundreds-father-404
09/28/2020, 9:13 PMwould allow us to actually configure completion info for the Process ?I don’t think we want this. Right now, streaming of test results is done in
test.py
. When you’re adding a new test implementation, you’ll get it working correctly no matter what. That’s importanthundreds-breakfast-49010
09/28/2020, 9:13 PMProcess
workunits DEBUG instead of INFO, and that got rid of the "Starting" message for Process
workunits?witty-crayon-22786
09/28/2020, 9:13 PMwitty-crayon-22786
09/28/2020, 9:14 PMhundreds-breakfast-49010
09/28/2020, 9:16 PMhundreds-father-404
09/28/2020, 9:16 PMProcess
to Debug is that it’s really noisy for us to say Completed process
and then immediately after stream the result via test.py
, which uses EngineAwareReturnType
hundreds-father-404
09/28/2020, 9:17 PMhundreds-breakfast-49010
09/28/2020, 9:17 PMhundreds-breakfast-49010
09/28/2020, 9:17 PMwitty-crayon-22786
09/28/2020, 9:17 PMwitty-crayon-22786
09/28/2020, 9:18 PMwitty-crayon-22786
09/28/2020, 9:19 PMhundreds-father-404
09/28/2020, 9:19 PM“pants finished executing some process” and “here is the result of a test”From a user perspective, the implementation detail would be leaking imo. There isn’t any new informtation gained by saying “completed process” and then immediately after “here’s the process output” Taking a step back from the current mechanisms, the user cares about this when
--no-dynamic-ui
is set:
* When the test run starts.
* When the test run finishes, and what its status + output is, where output depends on the --test-show-output
option
* Not too noisy.hundreds-father-404
09/28/2020, 9:20 PMbut also, only if it failed, right?No, we still need to say “test succeeded” vs. “test failed”. The
Process
will only say “test finished running” but zero insight on what the result waswitty-crayon-22786
09/28/2020, 9:20 PM* When the test run finishes, and what its status + output is, where output depends on theyes, but the default is “only on failure”, in which case you get a ton of output, and the extra line is a non-issue i think.option--test-show-output
witty-crayon-22786
09/28/2020, 9:21 PMhundreds-breakfast-49010
09/28/2020, 9:23 PMhundreds-breakfast-49010
09/28/2020, 9:23 PMhundreds-breakfast-49010
09/28/2020, 9:23 PMhundreds-breakfast-49010
09/28/2020, 9:23 PMProcess
workunit DEBUG and not worry about when a given test startedhundreds-father-404
09/28/2020, 9:25 PMwhich means they should care about when it stops running too, regardless of outcomeYes, they do care about this. Strong agreement. But they already get that via
142421.68 [INFO] Completed: Run tests - src/python/pants/util/strutil_test.py:tests succeeded.It would be confusing to get that and a message saying “Completed: Run tests for src/python/pants/util/strutil_tests.py:tests`. Why are you getting both? They say basically the same thing, but one is less helpful.
hundreds-breakfast-49010
09/28/2020, 9:26 PM@rule
right?witty-crayon-22786
09/28/2020, 9:26 PMhundreds-father-404
09/28/2020, 9:27 PMso: how do we push down richer information or logic to the ProcessWhich I don’t think we want from a Plugin API perspective https://pantsbuild.slack.com/archives/C0D7TNJHL/p1601327586055900?thread_ts=1601326361.048700&cid=C0D7TNJHL Perhaps there is a way to make it more automatic though
witty-crayon-22786
09/28/2020, 9:43 PMwitty-crayon-22786
09/28/2020, 9:43 PMwitty-crayon-22786
09/28/2020, 9:44 PM@rule
rendering for those (as in the test/lint/etc case), we should have those at info so that they get log output.witty-crayon-22786
09/28/2020, 9:46 PMwitty-crayon-22786
09/28/2020, 9:47 PMhundreds-father-404
09/28/2020, 9:48 PMwitty-crayon-22786
09/28/2020, 9:48 PMFor example, Protobuf gets run dozens of times and I think it would be really noisy to get every single run.only if the files have changed
witty-crayon-22786
09/28/2020, 9:49 PMwitty-crayon-22786
09/28/2020, 9:51 PMhundreds-father-404
09/28/2020, 9:51 PMand that should only be your first run locallyI do think that we need to consider your very first run for Pants, though. Are you going to get 50 lines of logs that you have to parse through?
witty-crayon-22786
09/28/2020, 9:54 PMwitty-crayon-22786
09/28/2020, 9:54 PMwitty-crayon-22786
09/28/2020, 9:56 PMwitty-crayon-22786
09/28/2020, 9:59 PM--dynamic-ui
when it is disabled, and then we’ll see where we are afterwards.hundreds-father-404
09/28/2020, 10:10 PM--no-dynamic-ui
is more important than I thought. We don’t only want it to toggle the “Starting” message. For many workunits, we also want it to toggle the “Completed” messagehundreds-father-404
09/28/2020, 10:11 PMwitty-crayon-22786
09/28/2020, 10:28 PM--no-dynamic-ui
will be (tweaking level vs finding a useful periodic thing that we can dump), but i think that i agree.hundreds-father-404
09/28/2020, 10:32 PM{dynamic ui x no_dynamic_ui} x {starting_level x ending_level}
The constructor would be ergonomic, such that you can only set level=LogLevel.DEBUG
for example and it will do that for everything. Or, you can get fancier if you want tight control, like we want with test
.
What’s holding me back is that logging is already a little tricky to reason about. And it’s really easy for someone to accidentally change something and break things without realizing. This adds lots of permutations
But then on the other side of my internal debate, I think it’s crucial we have an excellent UX for every edge case. Even if our code has to be complex to support it, I think that it’s worth it so that --dynamic-ui
isn’t too noisy, but also --no-dynamic-ui
is informative enough.witty-crayon-22786
09/28/2020, 10:36 PM--no-dynamic-ui
case that aligns the on/off case so that individual nodes don’t have to worry about that.witty-crayon-22786
09/28/2020, 10:36 PM