func (c JobExecutorClient) Watch(id string) (events chan ResultEvent) {
	events = make(chan ResultEvent)
	go func() {
		ticker := time.NewTicker(WatchInterval)
		for range ticker.C {
			result, err := c.Get(id)
			events <- ResultEvent{
				Result: result,
				Error:  err,
			}
			if err != nil || result.IsCompleted() {
				close(events)
				return
			}
		}
	}()
	return events
}
Watch will get valid execution after async Execute, execution will be returned when success or error occurs
Worker should set valid state for success or error after script completion
TODO add timeout
package client
import (
	"context"
	"fmt"
	"time"
	"github.com/kubeshop/testkube/internal/pkg/api/repository/result"
	"github.com/kubeshop/testkube/pkg/api/v1/testkube"
	"github.com/kubeshop/testkube/pkg/jobs"
)
func NewJobExecutorClient(repo result.Repository) (client JobExecutorClient, err error) {
	jobClient, err := jobs.NewJobClient()
	if err != nil {
		return client, fmt.Errorf("can't get k8s jobs client: %w", err)
	}
	return JobExecutorClient{
		Client:     jobClient,
		Repository: repo,
	}, nil
}
type JobExecutorClient struct {
	Client     *jobs.JobClient
	Repository result.Repository
}