Skip to content

Commit

Permalink
Fixes for user-tool (distributed-system-analysis#3440)
Browse files Browse the repository at this point in the history
* Fixes for user-tool

The tool meister was treating tools options as a concatenated string that
was passed as a single argument to `pbench-install/start/stop-tools`.
They are now split into separate arguments, allowing the scripts to work
correctly.

`pbench-postprocess-tools` was being called without empty tool options.
Instead of burrowing even deeper into the filesystem to grab the options,
we get rid of most of that by rewriting it to use `pbench-list-tools -g
<group> -o` and parsing the output of that script. The parsing is ugly
but is arguably less ugly than the file system ad-hockery that we used to
go through.

* Fix failures in the python tests

`test_install` was using a NullObject for a logger, but the `install`
method now logs its command. So we set up a basic logger to satisfy
that need.

Two other tests (`test_start` and `test_stop`) failed on an `is`
test. We now test for equality, rather than identity and the tests
pass. I'm not sure what caused these two failures, but the cause is
probably the breakup of the options into separate arguments.

* Fix  legacy util-scripts tests

Tests -51, -52 and -61 were failing because of the additional `install`
logging.

Tests -53, -56 and -57 now pass: the new output looks correct to me and
the old output looks wrong.

The util-scripts also pass in the CI container (run locally with
`jenkins/run tox -- agent util-scripts`), except for -51 and -52 which
fail with identical errors:

- pbench-tool-meister-stop: waiting for tool-data-sink (#####) to exit

The line is missing for some reason - I hope that the real Jenkins will
pass them, but it's not clear to me why they fail locally. OTOH, they do
pass locally when run with `tox -- agent util-scripts`.
Explanations/theories/guesses are welcome.

PBENCH-1172
  • Loading branch information
ndokos committed Jun 7, 2023
1 parent fd290c4 commit be5ffda
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 136 deletions.
12 changes: 8 additions & 4 deletions agent/util-scripts/gold/test-client-tool-meister/test-53.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Collecting system information
/var/tmp/pbench-test-utils/pbench/mock-run/0-iter-zero/sample42/tools-default/testhost.example.com/mpstat/mpstat-stop-postprocess.err
/var/tmp/pbench-test-utils/pbench/mock-run/0-iter-zero/sample42/tools-default/testhost.example.com/mpstat/mpstat-stop-postprocess.out
/var/tmp/pbench-test-utils/pbench/mock-run/0-iter-zero/sample42/tools-default/testhost.example.com/mpstat/mpstat.cmd
/var/tmp/pbench-test-utils/pbench/mock-run/0-iter-zero/sample42/tools-default/testhost.example.com/mpstat/mpstat.options
/var/tmp/pbench-test-utils/pbench/mock-run/0-iter-zero/sample42/tools-default/testhost.example.com/mpstat/online-cpus.txt
/var/tmp/pbench-test-utils/pbench/mock-run/1-iter-one
/var/tmp/pbench-test-utils/pbench/mock-run/1-iter-one/sample42
Expand All @@ -28,6 +29,7 @@ Collecting system information
/var/tmp/pbench-test-utils/pbench/mock-run/1-iter-one/sample42/tools-default/testhost.example.com/mpstat/mpstat-stop-postprocess.err
/var/tmp/pbench-test-utils/pbench/mock-run/1-iter-one/sample42/tools-default/testhost.example.com/mpstat/mpstat-stop-postprocess.out
/var/tmp/pbench-test-utils/pbench/mock-run/1-iter-one/sample42/tools-default/testhost.example.com/mpstat/mpstat.cmd
/var/tmp/pbench-test-utils/pbench/mock-run/1-iter-one/sample42/tools-default/testhost.example.com/mpstat/mpstat.options
/var/tmp/pbench-test-utils/pbench/mock-run/1-iter-one/sample42/tools-default/testhost.example.com/mpstat/online-cpus.txt
/var/tmp/pbench-test-utils/pbench/mock-run/metadata.log
/var/tmp/pbench-test-utils/pbench/mock-run/ssh_config
Expand Down Expand Up @@ -170,6 +172,7 @@ port 17001
# Redis is now ready to exit, bye bye...
--- mock-run/tm/redis.log file contents
+++ mock-run/tm/tm.err file contents
INFO pbench-tool-meister install -- mpstat: install_tool -- /var/tmp/pbench-test-utils/opt/pbench-agent/tool-scripts/mpstat --install --interval=42 --options=forty-two
INFO pbench-tool-meister sysinfo -- pbench-sysinfo-dump -- /var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/pbench-sysinfo-dump /var/tmp/pbench-test-utils/pbench/mock-run/sysinfo/beg/testhost.example.com block,security_mitigations,sos parallel
INFO pbench-tool-meister sysinfo -- testhost.example.com: sysinfo send (no-op) default /var/tmp/pbench-test-utils/pbench/mock-run/sysinfo/beg/testhost.example.com
INFO pbench-tool-meister start -- Started persistent tool dcgm, ['/var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/dcgm-exporter']
Expand All @@ -189,15 +192,16 @@ WARNING pbench-tool-meister end_tools -- testhost.example.com: unexpected temp f
INFO pbench-tool-meister sysinfo -- pbench-sysinfo-dump -- /var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/pbench-sysinfo-dump /var/tmp/pbench-test-utils/pbench/mock-run/sysinfo/end/testhost.example.com block,security_mitigations,sos parallel
INFO pbench-tool-meister sysinfo -- testhost.example.com: sysinfo send (no-op) default /var/tmp/pbench-test-utils/pbench/mock-run/sysinfo/end/testhost.example.com
INFO pbench-tool-meister __exit__ -- testhost.example.com: terminating
INFO pbench-tool-meister.logger-start log_raw_io_output -- mpstat: running "/var/tmp/pbench-test-utils/opt/pbench-agent/tool-scripts/datalog/mpstat-datalog 42 --options=forty-two "
INFO pbench-tool-meister.logger-start log_raw_io_output -- mpstat: running "/var/tmp/pbench-test-utils/opt/pbench-agent/tool-scripts/datalog/mpstat-datalog 42 forty-two"
INFO pbench-tool-meister.logger-stop log_raw_io_output -- mpstat: stopping
INFO pbench-tool-meister.logger-stop log_raw_io_output -- mpstat: post-processing following stop
INFO pbench-tool-meister.logger-start log_raw_io_output -- mpstat: running "/var/tmp/pbench-test-utils/opt/pbench-agent/tool-scripts/datalog/mpstat-datalog 42 --options=forty-two "
INFO pbench-tool-meister.logger-start log_raw_io_output -- mpstat: running "/var/tmp/pbench-test-utils/opt/pbench-agent/tool-scripts/datalog/mpstat-datalog 42 forty-two"
INFO pbench-tool-meister.logger-stop log_raw_io_output -- mpstat: stopping
INFO pbench-tool-meister.logger-stop log_raw_io_output -- mpstat: post-processing following stop
--- mock-run/tm/tm.err file contents
+++ mock-run/tm/tm.logs file contents
pbench-tool-meister-start - verify logging channel up
testhost.example.com INFO pbench-tool-meister install -- mpstat: install_tool -- /var/tmp/pbench-test-utils/opt/pbench-agent/tool-scripts/mpstat --install --interval=42 --options=forty-two
testhost.example.com INFO pbench-tool-meister sysinfo -- pbench-sysinfo-dump -- /var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/pbench-sysinfo-dump /var/tmp/pbench-test-utils/pbench/mock-run/sysinfo/beg/testhost.example.com block,security_mitigations,sos parallel
testhost.example.com INFO pbench-tool-meister sysinfo -- testhost.example.com: sysinfo send (no-op) default /var/tmp/pbench-test-utils/pbench/mock-run/sysinfo/beg/testhost.example.com
testhost.example.com INFO pbench-tool-meister start -- Started persistent tool dcgm, ['/var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/dcgm-exporter']
Expand All @@ -217,10 +221,10 @@ testhost.example.com WARNING pbench-tool-meister end_tools -- testhost.example.c
testhost.example.com INFO pbench-tool-meister sysinfo -- pbench-sysinfo-dump -- /var/tmp/pbench-test-utils/opt/pbench-agent/unittest-scripts/pbench-sysinfo-dump /var/tmp/pbench-test-utils/pbench/mock-run/sysinfo/end/testhost.example.com block,security_mitigations,sos parallel
testhost.example.com INFO pbench-tool-meister sysinfo -- testhost.example.com: sysinfo send (no-op) default /var/tmp/pbench-test-utils/pbench/mock-run/sysinfo/end/testhost.example.com
testhost.example.com INFO pbench-tool-meister __exit__ -- testhost.example.com: terminating
testhost.example.com INFO pbench-tool-meister.logger-start log_raw_io_output -- mpstat: running "/var/tmp/pbench-test-utils/opt/pbench-agent/tool-scripts/datalog/mpstat-datalog 42 --options=forty-two "
testhost.example.com INFO pbench-tool-meister.logger-start log_raw_io_output -- mpstat: running "/var/tmp/pbench-test-utils/opt/pbench-agent/tool-scripts/datalog/mpstat-datalog 42 forty-two"
testhost.example.com INFO pbench-tool-meister.logger-stop log_raw_io_output -- mpstat: stopping
testhost.example.com INFO pbench-tool-meister.logger-stop log_raw_io_output -- mpstat: post-processing following stop
testhost.example.com INFO pbench-tool-meister.logger-start log_raw_io_output -- mpstat: running "/var/tmp/pbench-test-utils/opt/pbench-agent/tool-scripts/datalog/mpstat-datalog 42 --options=forty-two "
testhost.example.com INFO pbench-tool-meister.logger-start log_raw_io_output -- mpstat: running "/var/tmp/pbench-test-utils/opt/pbench-agent/tool-scripts/datalog/mpstat-datalog 42 forty-two"
testhost.example.com INFO pbench-tool-meister.logger-stop log_raw_io_output -- mpstat: stopping
testhost.example.com INFO pbench-tool-meister.logger-stop log_raw_io_output -- mpstat: post-processing following stop
--- mock-run/tm/tm.logs file contents
Expand Down
Loading

0 comments on commit be5ffda

Please sign in to comment.