paritytech / zombienet

A cli tool to easily spawn ephemeral Polkadot/Substrate networks and perform tests against them.
https://paritytech.github.io/zombienet/
GNU General Public License v3.0
159 stars 91 forks source link

Add some logging of key network events #1601

Closed mrcnski closed 3 weeks ago

mrcnski commented 10 months ago

Is your feature request related to a problem? Please describe.

We were recently trying to debug a zombienet test where the issue ultimately was that one of the parachains was not producing blocks. It would have saved a lot of time if zombienet exposed some logs.

Describe the solution you'd like

It would be really nice if we could turn on some logs for zombienet to see key events like:

  1. Relay chain block 20 produced
  2. Relay chain block 20 finalized
  3. Parachain 100 block 5 produced
  4. Session 2 has started
  5. etc.

It would be immediately clear if something wasn't working, and would also help us visualize the tests better and potentially write better assertions.

This could e.g. be enabled with a CLI flag or an env var.

Discoverability: On test failures, zombienet could suggest using the new option to help debugging.

Describe alternatives you've considered

If there exists some way to do this already, it should be better documented because I don't know about it!

Additional context

No response

pepoviola commented 9 months ago

Hi @mrcnski, thanks for your feedback! I think is a good idea but I just want to ask you for getting a better picture since I'm planning to add some kind of repl into the spawning phase in the new version. From the point of view of the test-runner (testing phase) you can assert on the block production of the relay/para and you will easily see if there are some issue in the block production.

But having a debug logging in the test-runner that just emit some key events of the network could be handy.

Thx!

mrcnski commented 9 months ago

From the point of view of the test-runner (testing phase) you can assert on the block production of the relay/para and you will easily see if there are some issue in the block production.

That's true. The idea is just to get a better picture of what's going on in the network. You could add some tests manually, but it would be hard to answer questions like "how do blocks of para 100 compare with blocks of para 101?" (for example).

I guess polkadot-js already has something kind of like this, which I didn't realize. So maybe that's enough? It would just be a bit more convenient to have the information in one place, in the CLI, when running tests.

But having a debug logging in the test-runner that just emit some key events of the network could be handy.

Agreed!

pepoviola commented 3 weeks ago

Closing here now, I will add to feature list in sdk. Thanks!!