Skip to content

Expose ShutdownManager poll interval to speed up TestWorkflowEnvironment teardown #2869

@deepika-awasthi

Description

@deepika-awasthi

Is your feature request related to a problem? Please describe.
ShutdownManager.CHECK_PERIOD_MS is hard-coded to 250 ms. In env-per-test setups this dominates wall-time customer measured shutdown p50 = 506 ms (stock) vs 7 ms (after locally patching the constant).

Reproduced internally at ~257 ms/test.

Describe the solution you'd like
Either a builder option (WorkerFactoryOptions / TestEnvironmentOptions#setShutdownCheckInterval(Duration)) or, as a lighter first step, a system property like temporal.worker.shutdownCheckPeriodMs

Describe alternatives you've considered

  • One env per test class customer hit test-isolation issues.
  • Lowering the default for everyone might not be suitable for production shutdowns.

Additional context
private static final int CHECK_PERIOD_MS = 250

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions