venasolutions / bosk

Apache License 2.0
11 stars 4 forks source link

DriverStateVerifier #72

Closed prdoyle closed 1 year ago

prdoyle commented 1 year ago

Main change

The headliner is DriverStateVerifier. This component observes the events sent to / received from a BoskDriver and ensures that the outgoing events are consistent with the incoming ones. AbstractDriverTest (which includes DriverConformanceTest) now wraps the tested driver in a DriverStateVerifier to make sure it's propagating events correctly.

This turned out to be difficult when multiple threads are involved. Drivers are permitted to make certain changes to the event stream (as long as they have the same effect on the bosk state), and this, combined with figuring out the right interleaving of events from multiple threads based solely on the effect they had, turned out to be difficult.

I'm planning to take a break from this and implement a context propagation system, which I want anyway, and which will allow me to determine the source thread for each event, greatly simplifying the verification process.

Additional changes