@@ -1574,10 +1574,10 @@ func (e *WorkloadExecutor) runOp(op realOp, opIndex int) error {
1574
1574
func (e * WorkloadExecutor ) runCreateNodesOp (opIndex int , op * createNodesOp ) error {
1575
1575
nodePreparer , err := getNodePreparer (fmt .Sprintf ("node-%d-" , opIndex ), op , e .tCtx .Client ())
1576
1576
if err != nil {
1577
- return fmt . Errorf ( "op %d: %w" , opIndex , err )
1577
+ return err
1578
1578
}
1579
1579
if err := nodePreparer .PrepareNodes (e .tCtx , e .nextNodeIndex ); err != nil {
1580
- return fmt . Errorf ( "op %d: %w" , opIndex , err )
1580
+ return err
1581
1581
}
1582
1582
e .nextNodeIndex += op .Count
1583
1583
return nil
@@ -1586,14 +1586,14 @@ func (e *WorkloadExecutor) runCreateNodesOp(opIndex int, op *createNodesOp) erro
1586
1586
func (e * WorkloadExecutor ) runCreateNamespaceOp (opIndex int , op * createNamespacesOp ) error {
1587
1587
nsPreparer , err := newNamespacePreparer (e .tCtx , op )
1588
1588
if err != nil {
1589
- return fmt . Errorf ( "op %d: %w" , opIndex , err )
1589
+ return err
1590
1590
}
1591
1591
if err := nsPreparer .prepare (e .tCtx ); err != nil {
1592
1592
err2 := nsPreparer .cleanup (e .tCtx )
1593
1593
if err2 != nil {
1594
1594
err = fmt .Errorf ("prepare: %w; cleanup: %w" , err , err2 )
1595
1595
}
1596
- return fmt . Errorf ( "op %d: %w" , opIndex , err )
1596
+ return err
1597
1597
}
1598
1598
for _ , n := range nsPreparer .namespaces () {
1599
1599
if _ , ok := e .numPodsScheduledPerNamespace [n ]; ok {
@@ -1608,20 +1608,20 @@ func (e *WorkloadExecutor) runCreateNamespaceOp(opIndex int, op *createNamespace
1608
1608
func (e * WorkloadExecutor ) runBarrierOp (opIndex int , op * barrierOp ) error {
1609
1609
for _ , namespace := range op .Namespaces {
1610
1610
if _ , ok := e .numPodsScheduledPerNamespace [namespace ]; ! ok {
1611
- return fmt .Errorf ("op %d: unknown namespace %s" , opIndex , namespace )
1611
+ return fmt .Errorf ("unknown namespace %s" , namespace )
1612
1612
}
1613
1613
}
1614
1614
switch op .StageRequirement {
1615
1615
case Attempted :
1616
1616
if err := waitUntilPodsAttempted (e .tCtx , e .podInformer , op .LabelSelector , op .Namespaces , e .numPodsScheduledPerNamespace ); err != nil {
1617
- return fmt . Errorf ( "op %d: %w" , opIndex , err )
1617
+ return err
1618
1618
}
1619
1619
case Scheduled :
1620
1620
// Default should be treated like "Scheduled", so handling both in the same way.
1621
1621
fallthrough
1622
1622
default :
1623
1623
if err := waitUntilPodsScheduled (e .tCtx , e .podInformer , op .LabelSelector , op .Namespaces , e .numPodsScheduledPerNamespace ); err != nil {
1624
- return fmt . Errorf ( "op %d: %w" , opIndex , err )
1624
+ return err
1625
1625
}
1626
1626
// At the end of the barrier, we can be sure that there are no pods
1627
1627
// pending scheduling in the namespaces that we just blocked on.
@@ -1670,7 +1670,7 @@ func (e *WorkloadExecutor) runCreatePodsOp(opIndex int, op *createPodsOp) error
1670
1670
1671
1671
if op .CollectMetrics {
1672
1672
if e .collectorCtx != nil {
1673
- return fmt .Errorf ("op %d: Metrics collection is overlapping. Probably second collector was started before stopping a previous one" , opIndex )
1673
+ return fmt .Errorf ("Metrics collection is overlapping. Probably second collector was started before stopping a previous one" )
1674
1674
}
1675
1675
var err error
1676
1676
e .collectorCtx , e .collectors , err = startCollectingMetrics (e .tCtx , & e .collectorWG , e .podInformer , e .testCase .MetricsCollectorConfig , e .throughputErrorMargin , opIndex , namespace , []string {namespace }, nil )
@@ -1679,7 +1679,7 @@ func (e *WorkloadExecutor) runCreatePodsOp(opIndex int, op *createPodsOp) error
1679
1679
}
1680
1680
}
1681
1681
if err := createPodsRapidly (e .tCtx , namespace , op ); err != nil {
1682
- return fmt . Errorf ( "op %d: %w" , opIndex , err )
1682
+ return err
1683
1683
}
1684
1684
switch {
1685
1685
case op .SkipWaitToCompletion :
@@ -1688,11 +1688,11 @@ func (e *WorkloadExecutor) runCreatePodsOp(opIndex int, op *createPodsOp) error
1688
1688
e .numPodsScheduledPerNamespace [namespace ] += op .Count
1689
1689
case op .SteadyState :
1690
1690
if err := createPodsSteadily (e .tCtx , namespace , e .podInformer , op ); err != nil {
1691
- return fmt . Errorf ( "op %d: %w" , opIndex , err )
1691
+ return err
1692
1692
}
1693
1693
default :
1694
1694
if err := waitUntilPodsScheduledInNamespace (e .tCtx , e .podInformer , nil , namespace , op .Count ); err != nil {
1695
- return fmt .Errorf ("op %d: error in waiting for pods to get scheduled: %w" , opIndex , err )
1695
+ return fmt .Errorf ("error in waiting for pods to get scheduled: %w" , err )
1696
1696
}
1697
1697
}
1698
1698
if op .CollectMetrics {
@@ -1714,7 +1714,7 @@ func (e *WorkloadExecutor) runDeletePodsOp(opIndex int, op *deletePodsOp) error
1714
1714
1715
1715
podsToDelete , err := e .podInformer .Lister ().Pods (op .Namespace ).List (labelSelector )
1716
1716
if err != nil {
1717
- return fmt .Errorf ("op %d: error in listing pods in the namespace %s: %w" , opIndex , op .Namespace , err )
1717
+ return fmt .Errorf ("error in listing pods in the namespace %s: %w" , op .Namespace , err )
1718
1718
}
1719
1719
1720
1720
deletePods := func (opIndex int ) {
@@ -1771,20 +1771,20 @@ func (e *WorkloadExecutor) runChurnOp(opIndex int, op *churnOp) error {
1771
1771
// Ensure the namespace exists.
1772
1772
nsObj := & v1.Namespace {ObjectMeta : metav1.ObjectMeta {Name : namespace }}
1773
1773
if _ , err := e .tCtx .Client ().CoreV1 ().Namespaces ().Create (e .tCtx , nsObj , metav1.CreateOptions {}); err != nil && ! apierrors .IsAlreadyExists (err ) {
1774
- return fmt .Errorf ("op %d: unable to create namespace %v: %w" , opIndex , namespace , err )
1774
+ return fmt .Errorf ("unable to create namespace %v: %w" , namespace , err )
1775
1775
}
1776
1776
1777
1777
var churnFns []func (name string ) string
1778
1778
1779
1779
for i , path := range op .TemplatePaths {
1780
1780
unstructuredObj , gvk , err := getUnstructuredFromFile (path )
1781
1781
if err != nil {
1782
- return fmt .Errorf ("op %d: unable to parse the %v-th template path: %w" , opIndex , i , err )
1782
+ return fmt .Errorf ("unable to parse the %v-th template path: %w" , i , err )
1783
1783
}
1784
1784
// Obtain GVR.
1785
1785
mapping , err := restMapper .RESTMapping (gvk .GroupKind (), gvk .Version )
1786
1786
if err != nil {
1787
- return fmt .Errorf ("op %d: unable to find GVR for %v: %w" , opIndex , gvk , err )
1787
+ return fmt .Errorf ("unable to find GVR for %v: %w" , gvk , err )
1788
1788
}
1789
1789
gvr := mapping .Resource
1790
1790
// Distinguish cluster-scoped with namespaced API objects.
@@ -1870,7 +1870,7 @@ func (e *WorkloadExecutor) runChurnOp(opIndex int, op *churnOp) error {
1870
1870
func (e * WorkloadExecutor ) runDefaultOp (opIndex int , op realOp ) error {
1871
1871
runable , ok := op .(runnableOp )
1872
1872
if ! ok {
1873
- return fmt .Errorf ("op %d: invalid op %v" , opIndex , op )
1873
+ return fmt .Errorf ("invalid op %v" , op )
1874
1874
}
1875
1875
for _ , namespace := range runable .requiredNamespaces () {
1876
1876
err := createNamespaceIfNotPresent (e .tCtx , namespace , & e .numPodsScheduledPerNamespace )
@@ -1884,7 +1884,7 @@ func (e *WorkloadExecutor) runDefaultOp(opIndex int, op realOp) error {
1884
1884
1885
1885
func (e * WorkloadExecutor ) runStartCollectingMetricsOp (opIndex int , op * startCollectingMetricsOp ) error {
1886
1886
if e .collectorCtx != nil {
1887
- return fmt .Errorf ("op %d: Metrics collection is overlapping. Probably second collector was started before stopping a previous one" , opIndex )
1887
+ return fmt .Errorf ("Metrics collection is overlapping. Probably second collector was started before stopping a previous one" )
1888
1888
}
1889
1889
var err error
1890
1890
e .collectorCtx , e .collectors , err = startCollectingMetrics (e .tCtx , & e .collectorWG , e .podInformer , e .testCase .MetricsCollectorConfig , e .throughputErrorMargin , opIndex , op .Name , op .Namespaces , op .LabelSelector )
0 commit comments