Skip to content

Commit

Permalink
testing: fix a test for 32-bit
Browse files Browse the repository at this point in the history
The hcl decoding apparently uses strconv.ParseInt, which fails to parse a 64bit int.
Since hcl v1 is basically EOl, it seems unlikely we'll fix this in hcl.

Since this test is only about loading values from config files, the extra large number
doesn't seem important. Trim a few zeros from the numbers so that they parse
properly on 32bit platforms.

Also skip a slow test when -short is used.
  • Loading branch information
dnephin committed Jun 29, 2021
1 parent dce59d9 commit f34d354
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions agent/config/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5473,7 +5473,7 @@ func TestLoad_FullConfig(t *testing.T) {
HTTPSPort: 15127,
HTTPUseCache: false,
KeyFile: "IEkkwgIA",
KVMaxValueSize: 1234567800000000,
KVMaxValueSize: 1234567800,
LeaveDrainTime: 8265 * time.Second,
LeaveOnTerm: true,
Logging: logging.Config{
Expand Down Expand Up @@ -5868,7 +5868,7 @@ func TestLoad_FullConfig(t *testing.T) {
"wan_ipv4": "78.63.37.19",
},
TranslateWANAddrs: true,
TxnMaxReqLen: 5678000000000000,
TxnMaxReqLen: 567800000,
UIConfig: UIConfig{
Dir: "pVncV4Ey",
ContentPath: "/qp1WRhYH/", // slashes are added in parsing
Expand Down
4 changes: 2 additions & 2 deletions agent/config/testdata/full-config.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ limits {
rpc_rate = 12029.43
rpc_max_burst = 44848
rpc_max_conns_per_client = 2954
kv_max_value_size = 1234567800000000
txn_max_req_len = 5678000000000000
kv_max_value_size = 1234567800
txn_max_req_len = 567800000
}
log_level = "k1zo9Spt"
log_json = true
Expand Down
4 changes: 2 additions & 2 deletions agent/config/testdata/full-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@
"rpc_rate": 12029.43,
"rpc_max_burst": 44848,
"rpc_max_conns_per_client": 2954,
"kv_max_value_size": 1234567800000000,
"txn_max_req_len": 5678000000000000
"kv_max_value_size": 1234567800,
"txn_max_req_len": 567800000
},
"log_level": "k1zo9Spt",
"log_json": true,
Expand Down
4 changes: 4 additions & 0 deletions command/connect/redirecttraffic/redirect_traffic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ func TestRun_FlagValidation(t *testing.T) {
}

func TestGenerateConfigFromFlags(t *testing.T) {
if testing.Short() {
t.Skip("too slow for testing.Short")
}

cases := []struct {
name string
command func() cmd
Expand Down

0 comments on commit f34d354

Please sign in to comment.