Skip to content

Conversation

@schmichael
Copy link
Member

Description

Adding RequireConsul and RequireRoot checks to a lot of tests that are missing them. Highly unlikely to be comprehensive, but I want to land some progress before getting distracted.

Testing & Reproduction steps

go test github.com/hashicorp/nomad/client/allocrunner/taskrunner

Lots of tests should fail without this patch, especially if Consul isn't installed.

Links

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad website documentation to reflect this. Refer to
    the website README for docs guidelines. Please also consider whether the
    change requires notes within the upgrade guide.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal
    backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge"
    in the majority of situations. The main exceptions are long-lived feature branches or merges where
    history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry
    within the public repository.

Fixes some tests that were missing RequireConsul before. Doesn't remove
RequireConsul from tests that perform operations before calling
getTestConsul.
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I'm not 100% sure why all those taskrunner tests are requiring root, especially given they use the mock driver. But I suspect that's due to the changes we made for resources.cores and NUMA. As of #23803 which we did as part of the preliminaries for the "rootless Nomad" project, we should be able to perform those operations with cgroup delegation. It might be nice to swap out testutil.RequireRoot for a testutil.RequireOwnsCgroup in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants