Skip to content

Improve reliability of GoroutineMonitor stop check in tests #4519

@OhmSpectator

Description

@OhmSpectator

The TestGoroutineMonitorStops test in pkg/pillar/cmd/watcher/watcher_test.go sometimes fails with the error:

=== FAIL: cmd/watcher TestGoroutineMonitorStops (3.03s)
Failed to write to log, write |1: file already closed
    watcher_test.go:518: Expected log output to contain 'Stopping goroutines monitor'

This failure is likely due to the log output pipe being closed before the goroutines monitor has fully stopped and logged the "Stopping goroutines monitor" message. To make the stop check more reliable, we should either increase the wait time to ensure the goroutine monitor has entirely stopped before closing the log output pipe or introduce a reliable way to check that the goroutine is stopped.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions