open-nomad/website/content/docs/commands
Tim Gross 09b5e8d388
Fix flaky operator debug test (#12501)
We introduced a `pprof-interval` argument to `operator debug` in #11938, and unfortunately this has resulted in a lot of test flakes. The actual command in use is mostly fine (although I've fixed some quirks here), so what's really happened is that the change has revealed some existing issues in the tests. Summary of changes:

* Make first pprof collection synchronous to preserve the existing
  behavior for the common case where the pprof interval matches the
  duration.

* Clamp `operator debug` pprof timing to that of the command. The
  `pprof-duration` should be no more than `duration` and the
  `pprof-interval` should be no more than `pprof-duration`. Clamp the
  values rather than throwing errors, which could change the commands
  that existing users might already have in debugging scripts

* Testing: remove test parallelism

  The `operator debug` tests that stand up servers can't be run in
  parallel, because we don't have a way of canceling the API calls for
  pprof. The agent will still be running the last pprof when we exit,
  and that breaks the next test that talks to that same agent.
  (Because you can only run one pprof at a time on any process!)

  We could split off each subtest into its own server, but this test
  suite is already very slow. In future work we should fix this "for
  real" by making the API call cancelable.


* Testing: assert against unexpected errors in `operator debug` tests.

  If we assert there are no unexpected error outputs, it's easier for
  the developer to debug when something is going wrong with the tests
  because the error output will be presented as a failing test, rather
  than just a failing exit code check. Or worse, no failing exit code
  check!

  This also forces us to be explicit about which tests will return 0
  exit codes but still emit (presumably ignorable) error outputs.

Additional minor bug fixes (mostly in tests) and test refactorings:

* Fix text alignment on pprof Duration in `operator debug` output

* Remove "done" channel from `operator debug` event stream test. The
  goroutine we're blocking for here already tells us it's done by
  sending a value, so block on that instead of an extraneous channel

* Event stream test timer should start at current time, not zero

* Remove noise from `operator debug` test log output. The `t.Logf`
  calls already are picked out from the rest of the test output by
  being prefixed with the filename.

* Remove explicit pprof args so we use the defaults clamped from
  duration/interval
2022-04-07 15:00:07 -04:00
..
acl docs: update acl bootstrap command to show json and template opts. 2021-10-29 09:01:58 +02:00
alloc provide -no-shutdown-delay flag for job/alloc stop (#11596) 2021-12-13 14:54:53 -05:00
config docs and changelog for nomad config validate (#12031) 2022-02-09 10:20:45 -05:00
deployment Add go-bexpr filters to evals and deployment list endpoints (#12034) 2022-02-16 11:40:30 -05:00
eval Add go-bexpr filters to evals and deployment list endpoints (#12034) 2022-02-16 11:40:30 -05:00
job docs: update vault-token note in job run command #8040 (#12385) 2022-04-06 10:01:38 -07:00
license
namespace docs: add meta to namespace docs 2022-03-04 14:18:57 -08:00
node cli: add -quiet to nomad node status command. (#12426) 2022-04-05 15:53:43 -04:00
operator Fix flaky operator debug test (#12501) 2022-04-07 15:00:07 -04:00
plugin docs: clarify that plugin commands are for CSI only (#12151) 2022-03-01 07:57:41 -05:00
quota
recommendation
scaling
sentinel
server cli: display Raft version in server members (#12317) 2022-03-17 14:15:10 -04:00
service website: add initial website docs for Nomad service discovery. (#12456) 2022-04-06 18:51:14 +02:00
system
volume CSI: Add secrets flag support for delete volume (#11245) 2022-04-05 08:59:11 -04:00
agent-info.mdx
agent.mdx
index.mdx
monitor.mdx
status.mdx
ui.mdx cli: allow setting namespace and region in the nomad ui command (#11364) 2021-10-21 16:24:39 -04:00
version.mdx