SetOnActivityHeartbeatListener: How Do I Use This?


I’m trying to test some activity code. Ideally, I want to check that the code is heartbeating. I thought to use SetOnActivityHeartbeatListener, but I don’t think I can because ActivityInfo is internal. Did I miss something? Should I be looking to do this in a different way?


It has a public activity.Info alias.

Thank you! I see now it is in the code documentation. Oops.

For others:

import (

func TestSomething(t *testing.T) {
	testSuite := &testsuite.WorkflowTestSuite{}
	env := testSuite.NewTestActivityEnvironment()
	env.SetOnActivityHeartbeatListener(func(activityInfo *activity.Info, details converter.EncodedValues) {
		// code goes here

	d, err := env.ExecuteActivity(activityFunc, params)