MCPcopy Index your code
hub / github.com/php/frankenphp / TestFinishBootingAWorkerScript

Function TestFinishBootingAWorkerScript

phpmainthread_test.go:169–190  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

167}
168
169func TestFinishBootingAWorkerScript(t *testing.T) {
170 setupGlobals(t)
171
172 _, err := initPHPThreads(1, 1, nil)
173 assert.NoError(t, err)
174
175 // boot the worker
176 worker := getDummyWorker(t, "transition-worker-1.php")
177 convertToWorkerThread(phpThreads[0], worker)
178 phpThreads[0].state.WaitFor(state.Ready)
179
180 assert.NotNil(t, phpThreads[0].handler.(*workerThread).dummyContext)
181 assert.Nil(t, phpThreads[0].handler.(*workerThread).workerContext)
182 assert.False(
183 t,
184 phpThreads[0].handler.(*workerThread).isBootingScript,
185 "isBootingScript should be false after the worker thread is ready",
186 )
187
188 drainPHPThreads()
189 assert.Nil(t, phpThreads)
190}
191
192func TestReturnAnErrorIf2WorkersHaveTheSameFileName(t *testing.T) {
193 workers = []*worker{}

Callers

nothing calls this directly

Calls 6

setupGlobalsFunction · 0.85
initPHPThreadsFunction · 0.85
getDummyWorkerFunction · 0.85
convertToWorkerThreadFunction · 0.85
drainPHPThreadsFunction · 0.85
WaitForMethod · 0.80

Tested by

no test coverage detected