Skip to content

Commit

Permalink
Merge pull request #487 from fosterseth/fix_stabilize_tests_devel
Browse files Browse the repository at this point in the history
Make tests more stable by extending context timeout
  • Loading branch information
fosterseth authored Nov 16, 2021
2 parents f78e226 + 384545b commit 6d59160
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 134 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ linters:
# - wrapcheck # TODO: Errors passed upwards should be wrapped.

issues:
fix: true
exclude:
- "lostcancel" # TODO: Context is not canceled on multiple occasions. Needs more detailed work to be fixed.
- "SA2002|thelper|testinggoroutine" # TODO: Test interface used outside of its routine, tests need to be rewritten.
Expand Down
6 changes: 3 additions & 3 deletions tests/functional/lib/mesh/climesh.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ func (n *CLINode) Start() error {
nodedefPath := filepath.Join(n.dir, "nodedef.yaml")
ioutil.WriteFile(nodedefPath, strData, 0o644)
n.receptorCmd = exec.Command("receptor", "--config", nodedefPath)
stdout, err := os.Create(filepath.Join(n.dir, "stdout"))
stdout, err := os.OpenFile(filepath.Join(n.dir, "stdout"), os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0o600)
if err != nil {
return err
}
stderr, err := os.Create(filepath.Join(n.dir, "stderr"))
stderr, err := os.OpenFile(filepath.Join(n.dir, "stderr"), os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0o600)
if err != nil {
return err
}
Expand Down Expand Up @@ -654,7 +654,7 @@ func (m *CLIMesh) CheckControlSockets() bool {

// WaitForReady Waits for connections and routes to converge.
func (m *CLIMesh) WaitForReady(ctx context.Context) error {
sleepInterval := 100 * time.Millisecond
sleepInterval := 500 * time.Millisecond
if !utils.CheckUntilTimeout(ctx, sleepInterval, m.CheckControlSockets) {
return errors.New("timed out while waiting for control sockets")
}
Expand Down
Loading

0 comments on commit 6d59160

Please sign in to comment.