tholian-network / stealth

:rocket: Stealth - Secure, Peer-to-Peer, Private and Automateable Web Browser/Scraper/Proxy
GNU General Public License v3.0
1.04k stars 301 forks source link

Covert: Results' assert() calls should be sorted as-in-file #77

Closed cookiengineer closed 3 years ago

cookiengineer commented 3 years ago

Currently, the Results implementation assumes every assert() call to be called exactly once, and once only. This is wanted, but as of now can lead to side effects.

As writing a Review for network protocols and network flows can fire events multiple times (by accident, while the implementation is still broken), there should be away to see what specific assert() call was called inside the describe() block of the currently executed test.

The trace_assert() method already can trace the specific assert call, but the Results expect an incremented this.index < this.data.length everywhere - which is kind of incorrect as a) the index can exceed the data.length in those scenarios and b) the index doesn't reflect the actual index of the assert call.

In order to implement this, there are a couple of things necessary:

cookiengineer commented 3 years ago

As of https://github.com/tholian-network/stealth/commit/ffff6d8b53d416068e316d41a93c7436e593edc2 this has been implemented. results.assert() and timeline.time() calls are now code-aligned, and represent the occurance index of the equivalent assert() call inside the test of the review.

If a timeout or interval fires later in time, it will set the results and timeline values accordingly at the correct position.