You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Testing the PVF validation host is quite annoying. This system implements a queue that is handled by workers. Workers are spawned as external processes. Moreover, they are spawned using the exec call that points to the same binary with a special command line flags.
The current system tried to anticipate this. Despite that it's still pain to test. Everything that touches effectful IO, especially process creation, is just pain.
It's possible to separate the system in two parts: a state machine and a dumb IO shell.
The dumb IO shell is responsible for spawning new processes, reporting their death, sending and receiving messages from them. The state machine part handles the queue logic, issues commands for spawning new processes and commands sending messages to specific processes. It's very important that that part doesn't actually perform any logic.
The hope is to isolate the IO shell making the interaction protocol with it very slim. That would enable us to test various behaviors. A puppet worker seems to be enough to cover many scenarios. Things like die before start work, fail to spawn, explode on a message seem all easy enough.
The state machine should be inherently easier to test. Input some commands, catch some requests coming out of it and reply with responses specific to the test scenario.
The text was updated successfully, but these errors were encountered:
Testing the PVF validation host is quite annoying. This system implements a queue that is handled by workers. Workers are spawned as external processes. Moreover, they are spawned using the
exec
call that points to the same binary with a special command line flags.The current system tried to anticipate this. Despite that it's still pain to test. Everything that touches effectful IO, especially process creation, is just pain.
It's possible to separate the system in two parts: a state machine and a dumb IO shell.
The dumb IO shell is responsible for spawning new processes, reporting their death, sending and receiving messages from them. The state machine part handles the queue logic, issues commands for spawning new processes and commands sending messages to specific processes. It's very important that that part doesn't actually perform any logic.
The hope is to isolate the IO shell making the interaction protocol with it very slim. That would enable us to test various behaviors. A puppet worker seems to be enough to cover many scenarios. Things like die before start work, fail to spawn, explode on a message seem all easy enough.
The state machine should be inherently easier to test. Input some commands, catch some requests coming out of it and reply with responses specific to the test scenario.
The text was updated successfully, but these errors were encountered: