Comments (8)
I think this is most appropriately phrased as the question of what's our recommended best-practice for synchronizing numerous instances of openhtf, particularly when using shared test equipment. My thought is that many plugs for interacting with test equipment will end up included custom test start triggers in their codebase, such as one that waits for multiple stations to frob it before returning any station's call.
I recall discussing this with @grybmadsci a little while back, but I don't recall whether we came to any brilliant conclusions.
from openhtf.
Hi, wondering if anyone has any additional thoughts on this?
from openhtf.
The simplest solution is to have your entrypoint wait for the start event (pressing the start button or something) as well as start all the other test instances, sharing a threading.Event()
instance between their start triggers. However, that requires the ability to run multiple openhtf instances in the same process, which I don't think is simple at the moment due to the use of gflags.
You could instead use multiprocessing.Process()
to make all your instances from one binary, where you'd set FLAGS.http_port
and other flags before running openhtf.Test(...).Execute(...)
. If you pass an multiprocessing.Event()
in, then all the start triggers can wait()
on that and have the main process set()
it when the start event is triggered.
A third way is to write a binary that does the listening for the start event and also creates a bound socket.socket
'server' that just stores all its connections into a list. When it gets a start event, it sends some string into all the connections (catching and ignoring errors from clients that got disconnected in the process). The others would all connect to that socket and wait for data to come in. This allows starting and stopping the 'stations' independently, if that's something you want.
Sadly, they're all pretty complicated. If we could have multiple tests execute in the same thread, I would propose adding a function (possibly in contrib
?) that accepted a list of openhtf.Test
objects and a test_start
and/or test_stop
to synchronize the rest on.
from openhtf.
My team needs some sync stuff too, and I'm thinking of implementing a generic sync service in util
as a run-able module. This would be similar to a simplified version of the third approach @fahhem lists above, where a separate service waits for frobs from a configured set of agents before returning any of the station's calls. The stations, on the other hand, would be able to use the corresponding start trigger and plug, with a configurable address of an individual instance of the sync service to contact.
from openhtf.
Folks, I want to revive the discussion around multi-up as it is going to be an important feature for my group as well. With looping taken out of the framework itself, we currently have potential for at least serial execution of multiple test objects within the same script. We've also talked about taking Execute() off of the main thread. I'd like to get a feel for what people need or want to see in terms of patterns for authoring multi-up tests, and how multi-up stations should look in the frontend (especially if running multiple tests in parallel).
from openhtf.
Execute()
can already run off the main thread. I think at this point we need to collect some concrete requirements and see which of them we can solve by establishing conventions, and which we might need to solve with some helper utility code.
from openhtf.
Some requirements from my group:
- Frontend overview that shows all cells and a summary of their state on one screen.
- Code examples of multi-cell recommended patterns (requested for v1.0 release).
- Ability to start all cells simultaneously from the frontend.
- Ability to drill down into full test view on an individual cell in the frontend.
- Ability to see recent history from all cells in the frontend. Not clear whether some form of cell tagging
is needed in the UI to indicate which cell a test run happened on.
from openhtf.
Closing this as obsolete because there's a whole new different frontend now!
from openhtf.
Related Issues (20)
- If plug configuration is dynamic (e.g. configs loaded from a file), how can the decorators be updated accordingly? HOT 2
- frontend_example with PyInstaller HOT 3
- Running a phase in backgroud HOT 7
- Request: Add ability to FAIL_AND_CONTINUE instead of STOP when a Phase reaches max_repeats
- How to build a test running multiple test groups concurrently, but showing I/O data of all test groups on the same webpage? HOT 1
- HIL testing? HOT 5
- multiple monitors for a single phase?
- KeyError in `PlugManager.provide_plugs` HOT 6
- monitors decorator does not fully copy the specification of the monitored phase
- Feature Request(?): Provide a mechanism for displaying images in the front-end HOT 1
- Progress bar/completion status stops if test is marked as FAIL. HOT 4
- How could I call a PhaseDescriptor explicitly? HOT 3
- runtime reporting/logging for each phase during test HOT 6
- Having trouble using the unit test decorator @test.patch_plugs to mock a device I'm testing. HOT 3
- where PyOpenSSL is used?
- Unused `six` import in monitor code
- Replacing `M2Crypto` dependency with `cryptography`
- Status LED on failure HOT 1
- Multiple tests or one test and multiple subtests?
- Best practice on how to organize product-dependent tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openhtf.