Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/workers/active_scenario.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ func (s *ActiveScenario) Setup() {
s.m.RecordSetupResult(s.scenario.Name, metrics.Result(s.t.Failed()), duration)
}

func (s *ActiveScenario) newIterationState() *iterationState {
func (s *ActiveScenario) newIterationState(id int) *iterationState {
t, teardown := testing.NewTWithOptions(s.scenario.Name,
testing.WithVUID(id),
testing.WithLogger(s.logger),
testing.WithLogrusLogger(s.logrusLogger),
)
Expand Down
2 changes: 1 addition & 1 deletion internal/workers/pool_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func New(maxIterations uint64, activeScenario *ActiveScenario) *PoolManager {
func (m *PoolManager) makeIterationStatePool(numWorkers int) []*iterationState {
statePool := make([]*iterationState, numWorkers)
for i := range numWorkers {
statePool[i] = m.activeScenario.newIterationState()
statePool[i] = m.activeScenario.newIterationState(i)
}

return statePool
Expand Down
7 changes: 7 additions & 0 deletions pkg/f1/testing/t.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type T struct {
require *require.Assertions
Iteration string // iteration number or "setup"
Scenario string
VUID int
teardownStack []func()
failed atomic.Bool
teardownFailed atomic.Bool
Expand Down Expand Up @@ -57,6 +58,12 @@ func WithIteration(iteration string) TOption {
}
}

func WithVUID(id int) TOption {
return func(t *T) {
t.VUID = id
}
}

// NewT returns a new T state
//
// Deprecated: Will be removed in favour of NewTWithOptions
Expand Down