# How to delay an activity during testing

**URL:** <https://community.temporal.io/t/how-to-delay-an-activity-during-testing/9981>\
**Category:** Community Support\
**Tags:** go-sdk, activity, testing\
**Created:** [November 1, 2023, 7:47pm UTC](https://community.temporal.io/t/how-to-delay-an-activity-during-testing/9981 "2023-11-01T19:47:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![darewreck](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@darewreck](https://community.temporal.io/u/darewreck)\
**Post date:** [November 1, 2023, 7:47pm UTC](https://community.temporal.io/t/how-to-delay-an-activity-during-testing/9981/1 "2023-11-01T19:47:48Z")

</div>

Hi,

I have the following.

```auto
 s.env.OnActivity(<activity>).Return(nil).Run(func(args mock.Arguments) {
		time.Sleep(2 * time.Second)
	})
s.env.ExecuteWorkflow(...)

```

in my workflow, after the activity is executed it calls `(workflow.Now(ctx))` to store the time. I want to validate that time to validate things activities are being called in parallel vs sequential. However, when I add the `sleep` it seems to have no effect on the workflow clock.

I’m wondering if the delay logic is incorrect

I know there is a `RegisterDelayedCallback`, and looks at the example where they use this to trigger `Signals` but not sure how I would use this when a mocked out activity response

Thank,  
Derek
