Skip to content
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

[antithesis] Add tmpnet support to workloads to simplify development #3215

Merged
merged 6 commits into from
Aug 14, 2024

Conversation

marun
Copy link
Contributor

@marun marun commented Jul 23, 2024

Why this should be merged

Iterating on the workload for the avalanchego test setup is simple - just launch a local node. Iterating on the tests for any VM is more complicated due to needing to deploy a subnet and chain. This PR adds tmpnet integration to make iterating on an antithesis workload as simple as iterating on an e2e test.

How this works

  • added support for starting a tmpnet network for a workload when URIs of a running network are not provided
  • implemented non-ginkgo version of TestContext to support reuse of tmpnet test helpers
  • replaced the use of log.Fatalf with require and a panic-based require.TestingT to ensure deferred cleanup functions can execute to enable reliable teardown of tmpnet networks
    • log.Fatalf calls os.Exit which precludes the execution of deferred functions
  • replaces the use of context.Background() with a context created with signal.NotifyContext to support orderly shutdown when SIGINT (i.e. Ctrl-C) and SIGTERM signals are received

How this was tested

Existing CI, plus added a new sanity check for workloads running with tmpnet

TODO

  • Set new CI job required post-merge

@marun marun added the testing This primarily focuses on testing label Jul 23, 2024
@marun marun self-assigned this Jul 23, 2024
@marun marun force-pushed the antithesis-refactor-workload branch from 24c80b1 to 0367e61 Compare July 23, 2024 01:48
@marun marun force-pushed the antithesis-refactor-workload branch from 0367e61 to f6d2bf4 Compare July 31, 2024 05:45
@marun marun changed the base branch from master to e2e-test-context July 31, 2024 05:45
@marun marun force-pushed the e2e-test-context branch from 9f301eb to 99294e5 Compare July 31, 2024 06:01
@marun marun force-pushed the antithesis-refactor-workload branch from f6d2bf4 to 8ec0f5d Compare July 31, 2024 06:02
@marun marun force-pushed the e2e-test-context branch from 99294e5 to 4945ee2 Compare July 31, 2024 06:13
@marun marun force-pushed the antithesis-refactor-workload branch from 8ec0f5d to 4f9746b Compare July 31, 2024 06:13
@marun marun force-pushed the e2e-test-context branch from 4945ee2 to 0852b62 Compare August 2, 2024 09:22
@marun marun force-pushed the antithesis-refactor-workload branch from 4f9746b to 7c095ec Compare August 2, 2024 09:22
@marun marun force-pushed the e2e-test-context branch from 0852b62 to f5d5571 Compare August 2, 2024 18:12
@marun marun force-pushed the antithesis-refactor-workload branch from 7c095ec to 5e26b9d Compare August 2, 2024 18:26
Base automatically changed from e2e-test-context to master August 2, 2024 18:54
@marun marun force-pushed the antithesis-refactor-workload branch 4 times, most recently from dbaf205 to 060ddee Compare August 7, 2024 04:17
@marun marun marked this pull request as ready for review August 7, 2024 04:18
@marun marun force-pushed the antithesis-refactor-workload branch from 060ddee to a7ef5ec Compare August 7, 2024 04:28
Comment on lines 22 to 23
// TODO(marun) Consider a more descriptive name for this type
type OtherTestContext struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

optional - seems like renaming this would be worthwhile in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggestions?

Copy link
Collaborator

Choose a reason for hiding this comment

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

DefaultTestContext ?

Copy link
Collaborator

@aaronbuchwald aaronbuchwald Aug 13, 2024

Choose a reason for hiding this comment

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

May be weird because it's not a default so much as, if nothing else (ie not ginkgo) fall back to this, but we typically use ginkgo

Copy link
Contributor

Choose a reason for hiding this comment

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

Also not a huge fan of Other... Simple? Fallback? Default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

NonGinkgo is a bit wordy, Default isn't really true, so Simple it is. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@marun marun force-pushed the antithesis-refactor-workload branch 2 times, most recently from 860ad11 to 2a454b2 Compare August 12, 2024 19:22
Copy link
Contributor

@StephenButtolph StephenButtolph left a comment

Choose a reason for hiding this comment

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

lgtm - would also like to rename OtherTestContext... But I don't love any of my ideas

Comment on lines 22 to 23
// TODO(marun) Consider a more descriptive name for this type
type OtherTestContext struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Also not a huge fan of Other... Simple? Fallback? Default?

@marun marun force-pushed the antithesis-refactor-workload branch from 2a454b2 to d65bff9 Compare August 13, 2024 23:24
@marun marun force-pushed the antithesis-refactor-workload branch from d65bff9 to b2ea47a Compare August 13, 2024 23:25
@StephenButtolph StephenButtolph added this pull request to the merge queue Aug 14, 2024
Merged via the queue into master with commit 2eef641 Aug 14, 2024
21 checks passed
@StephenButtolph StephenButtolph deleted the antithesis-refactor-workload branch August 14, 2024 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing This primarily focuses on testing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants