databendlabs / openraft

rust raft with improvements
Apache License 2.0
1.41k stars 158 forks source link

Add test suite to ensure the correctness of `AsyncRuntime` implementation. #1209

Closed drmingdrmer closed 3 months ago

github-actions[bot] commented 4 months ago

👋 Thanks for opening this issue!

Get help or engage by:

SteveLauC commented 4 months ago

I wonder what kinds of tests we should add for an implementation of AsyncRuntime, for this test suite, I think we should verify the functions and primitives will work correctly.

I also want to run some integration tests to check if Openraft would work with the runtime as well.

Thoughts on this?

drmingdrmer commented 4 months ago

For example for Mutex, it should provide exclusive accessing to some value. Such as: https://github.com/drmingdrmer/openraft/blob/bc4b4e54661308ae47b88b39373f82c54dd5780c/openraft/src/sync/mutex.rs#L130-L168

And similar to other components. At least the very basic behavior should be guaranteed by these tests. There is also a test suite to ensure the behaviors of RaftLogStorage:

https://github.com/drmingdrmer/openraft/blob/113-mutex/openraft/src/testing/suite.rs

SteveLauC commented 4 months ago

At least the very basic behavior should be guaranteed by these tests.

Will give this a try this morning.

There is also a test suite to ensure the behaviors of RaftLogStorage

Yeah, I am thinking about putting the test suite for logs and state machine in a module log, and adding another module runtime for the tests of AsyncRuntime.

SteveLauC commented 3 months ago

Looks like this can be closed as well. 😀

drmingdrmer commented 3 months ago

Aye!