MCPcopy Index your code
hub / github.com/coder/coder / loggingWaitFile

Function loggingWaitFile

cli/server_test.go:2125–2143  ·  view source on GitHub ↗
(t *testing.T, fiName string, dur time.Duration)

Source from the content-addressed store, hash-verified

2123}
2124
2125func loggingWaitFile(t *testing.T, fiName string, dur time.Duration) {
2126 var lastStat os.FileInfo
2127 require.Eventually(t, func() bool {
2128 var err error
2129 lastStat, err = os.Stat(fiName)
2130 if err != nil {
2131 if !os.IsNotExist(err) {
2132 t.Fatalf("unexpected error: %v", err)
2133 }
2134 return false
2135 }
2136 return lastStat.Size() > 0
2137 },
2138 dur, //nolint:gocritic
2139 testutil.IntervalFast,
2140 "file at %s should exist, last stat: %+v",
2141 fiName, lastStat,
2142 )
2143}
2144
2145func TestServer_Production(t *testing.T) {
2146 t.Parallel()

Callers 2

TestServerFunction · 0.85

Calls 2

SizeMethod · 0.80
FatalfMethod · 0.45

Tested by

no test coverage detected