server: add unit tests

Make test coverage >= 90%

#1019 
@philips remove `ctx` field in `Node`, and remove error return of `Tick`
they are not used anywhere