hashgraph / hedera-services

Crypto, token, consensus, file, and smart contract services for the Hedera public ledger
Apache License 2.0
313 stars 138 forks source link

test feat: BDD record stream validators need usage documentation (at least) to prevent flaky tests #16559

Open david-bakin-sl opened 4 days ago

david-bakin-sl commented 4 days ago

It's hard to use BDD record stream validators (*) correctly in the absence of documentation, and/or possibly framework changes. There are delays that are necessary to prevent flaky tests (especially since the CI environment uses testSubprocess where the normal dev usage on a local machine is to use testEmbedded, and they behave differently).

Suggest either a cookbook entry describing how to do this correctly/reliably and/or framework changes so that if you use record stream validation "is just works".

Some questions that could be answered:

david-bakin-sl commented 4 days ago

(w.r.t. StreamValidationOp class is when should you add a validator to RECORD_STREAM_VALIDATORS? Also, to make that class easier to use, it it turns out it is supposed to be used generally, can RECORD_STREAM_VALiDATORS be protected so you can subclass it in a test? Or maybe just a setter so you can add to it? Or something like that?)