Skip to content

Adding new sleep task#7226

Merged
pmahindrakar-oss merged 1 commit intov2from
sleep-task
Apr 20, 2026
Merged

Adding new sleep task#7226
pmahindrakar-oss merged 1 commit intov2from
sleep-task

Conversation

@pmahindrakar-oss
Copy link
Copy Markdown
Contributor

@pmahindrakar-oss pmahindrakar-oss commented Apr 16, 2026

Why are the changes needed?

We need a lightweight in-process sleep task for leaseworker stress testing that does not rely on global plugin config or create task pods.

What changes were proposed in this pull request?

This PR adds a new core task plugin, core-sleep, which:

  • takes one typed Duration input
  • stays Running until the duration elapses
  • completes on reconcile once elapsed
  • keeps per-task start time in memory
  • clears state on finalize

It also returns a user failure for invalid or missing duration input.

How was this patch tested?

Added unit tests for:

  • immediate success for zero duration
  • running-to-success behavior after elapsed time
  • invalid input handling

Tested with:

go test ./flyteplugins/go/tasks/plugins/core/sleep

Labels

  • added

Setup process

N/A

Screenshots

N/A

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

  • Related SDK PR for core-sleep

Docs link

N/A

@github-actions github-actions Bot mentioned this pull request Apr 16, 2026
3 tasks
Signed-off-by: pmahindrakar-oss <prafulla.mahindrakar@gmail.com>
@pmahindrakar-oss pmahindrakar-oss merged commit f114d96 into v2 Apr 20, 2026
20 checks passed
@pmahindrakar-oss pmahindrakar-oss deleted the sleep-task branch April 20, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants