github.com/kjdelisle/consul@v1.4.5/agent/testagent_test.go (about)

     1  package agent
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/hashicorp/consul/agent/config"
     7  	"github.com/hashicorp/hcl"
     8  )
     9  
    10  // TestDefaultConfig triggers a data race in the HCL parser.
    11  func TestDefaultConfig(t *testing.T) {
    12  	for i := 0; i < 500; i++ {
    13  		t.Run("", func(t *testing.T) {
    14  			t.Parallel()
    15  			var c config.Config
    16  			data := config.DefaultSource().Data
    17  			hcl.Decode(&c, data)
    18  			hcl.Decode(&c, data)
    19  			hcl.Decode(&c, data)
    20  			hcl.Decode(&c, data)
    21  			hcl.Decode(&c, data)
    22  			hcl.Decode(&c, data)
    23  			hcl.Decode(&c, data)
    24  			hcl.Decode(&c, data)
    25  			hcl.Decode(&c, data)
    26  		})
    27  	}
    28  }