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

Better Parallized Code Testing Support (Threading, Multi-Processes, Green Threads, Co-routines) #57

Open
4 tasks
BenjamenMeyer opened this issue Nov 1, 2017 · 0 comments

Comments

@BenjamenMeyer
Copy link
Member

Presently StackInABox works best in a single thread model. That is, if the test invokes multiple threads it's possible that one or more of the threads may not see the services offered by StackInABox. Some testing is necessary to confirm this, but it's highly likely since StackInABox uses thread-local storage for maintaining its environment.

Several points about this story:

  • Tests should be able to run in parallel and therefore multiple stacks should be able to be used at the same time without conflicting
  • Tests should be able to use multiple threads and be able to access the same stack
  • Tests should be able to use multiple processes and be able to access the same stack
  • green threads (eventlet, gevent), and co-routines (asyncio in Py3) should also be supported

It might be that the key used for accessing the stack may need to contain the test name. Introspection of the call stack might be able to help. This needs a lot of thought and planning to do right.

Note: The parallized tests usually use multiple processes; so at a minimum parallized tests and threading within the code being tested should be supported.

Note: It should be acceptable to add locking in the stacks even if it degrades performance during the test. If this can be avoided great; but if it can't be for the initial feature that's okay too.

@BenjamenMeyer BenjamenMeyer added this to the Future Work/Backlog milestone Nov 1, 2017
@BenjamenMeyer BenjamenMeyer changed the title Better Threading Support Better Parallized Code Testing Support (Threading, Multi-Processes, Green Threads, Co-routines) Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant