{"record":{"id":"403cae150766bac7","repo":"grafana/k6","slug":"at-least-2-points-are-needed-for-an-execution-segm","errorCode":null,"errorMessage":"at least 2 points are needed for an execution segment sequence, %d given","messagePattern":"at least 2 points are needed for an execution segment sequence, (.+?) given","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/execution_segment.go","lineNumber":331,"sourceCode":"\t\t\t\t)\n\t\t\t}\n\t\t\tto = segment.to\n\t\t}\n\t}\n\treturn ExecutionSegmentSequence(segments), nil\n}\n\n// NewExecutionSegmentSequenceFromString parses strings of the format\n// \"r1,r2,r3,...,rn\", which represents the sequences like (r1, r2], (r2, r3],\n// (r3, r4], ..., (r{n-1}, rn].\nfunc NewExecutionSegmentSequenceFromString(strSeq string) (ExecutionSegmentSequence, error) {\n\tif len(strSeq) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tpoints := strings.Split(strSeq, \",\")\n\tif len(points) < 2 {\n\t\treturn nil, fmt.Errorf(\"at least 2 points are needed for an execution segment sequence, %d given\", len(points))\n\t}\n\tvar start *big.Rat\n\n\tsegments := make([]*ExecutionSegment, 0, len(points)-1)\n\tfor i, point := range points {\n\t\trat, err := stringToRat(point)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif i == 0 {\n\t\t\tstart = rat\n\t\t\tcontinue\n\t\t}\n\n\t\tsegment, err := NewExecutionSegment(start, rat)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/lib/execution_segment.go#L313-L349","documentation":"NewExecutionSegmentSequenceFromString was given a string with fewer than two comma-separated points. A sequence needs at least a start and an end to define even a single segment — '1/2' alone is one point, which defines nothing.","triggerScenarios":"Thrown at lib/execution_segment.go:331 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide at least two points, e.g. '0,1/2,1'","For a single segment use the segment form '0:1/2' rather than a sequence string"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}