hashgraph / hedera-services

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

Move some HSCS HAPI Tests into Time Consuming bucket #16182

Open Nana-EC opened 1 month ago

Nana-EC commented 1 month ago

Problem

It looks like HSCS tests can be split tests between HAPI Test (Smart Contracts) and HAPI Test (Time Consuming) but it's unclear which

Solution

Based on recent CI runs determine which tests are time consuming and are okay to be moved to the Time Consuming bucket

Alternatives

No response

david-bakin-sl commented 4 weeks ago

My first consideration comments:

I think the slowness is that they run the 3-node version of the hapispecs and that uses the real network delays that we know - and our suites are deploying contracts for each and every test and then do calls (frequently multiple calls). most other suites just set up a few accounts and then run a transaction or two.

One thing we could consider - somehow figuring out how to initialize the tests with all contracts deployed and then run against those contracts. Even if done suite-by-suite it might be (significantly) faster because we reuse contracts over tests in a suite. An overall initialization would be best but probably very hard to arrange. (Obviously there will be exceptions that can't work this way, like tests for contract create or self destruct, but the vast majority of our tests use the contracts immutably.). This may be as simple as using the relatively new @Contract declaration religiously.

And we could also look at coalescing our test contracts so that each suite used only one contract, and that could get deployed once per suite. We currently have 229 contracts as resources ... we could prune that significantly I bet. Take a lot of work to do that and change the tests but we could do it incrementally.