Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation host is not amenable for thorough testing #2342

Open
pepyakin opened this issue Jul 6, 2021 · 0 comments
Open

Validation host is not amenable for thorough testing #2342

pepyakin opened this issue Jul 6, 2021 · 0 comments
Labels
I4-refactor Code needs refactoring. T10-tests This PR/Issue is related to tests.

Comments

@pepyakin
Copy link
Contributor

pepyakin commented Jul 6, 2021

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-right-joyce the-right-joyce transferred this issue from paritytech/polkadot Nov 15, 2023
@github-actions github-actions bot added the I10-unconfirmed Issue might be valid, but it's not yet known. label Nov 15, 2023
@the-right-joyce the-right-joyce added I4-refactor Code needs refactoring. T10-tests This PR/Issue is related to tests. and removed I10-unconfirmed Issue might be valid, but it's not yet known. labels Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I4-refactor Code needs refactoring. T10-tests This PR/Issue is related to tests.
Projects
Status: Backlog
Development

No branches or pull requests

2 participants