Clone
Jendrik Johannes
committed
on 09 Oct 19
Make http server fixture's handle() thread safe
As stated in the here implemented 'ServerWithExpectations' fixture:
"handlers, as well as fa… Show more
Make http server fixture's handle() thread safe

As stated in the here implemented 'ServerWithExpectations' fixture:

"handlers, as well as failures, need to be thread-safe"

This concrete case was working most of the time since usually there are

not more than one expectations for the same request. But if the

same request is expected several times, and the requests are received

in parallel (as it is the case for metadata download), the handle()

method behaved flaky - by not doing reading and updating of the 'run'

flag as an atomic operation.

Show less