main: add basic integration test

wait on #1315 
it is added for graceful stop, which means that the run loop is over when Stop() finishes.

One benefit is that it ensures that no more new request will be sent after Stop(), so tests could close httptest server and its underlying connections. Or it may introduce data race when closing connections.