Fix NetworkScoreTest flake
Some tests flake because the previous test networks are
still registered. It's not very clear how this can happen
considering `tearDown` is waiting for each agent to be
torn down, but logs suggest that the array of agents may
not contain all agents at `tearDown` time, and `tearDown`
does not run on the same thread as the test. It's hard
to imagine that there isn't a memory barrier between the
end of the test and the start of `tearDown`, but that's
the only hypothesis at this point.
Also add logs that will help diagnose further in case
the (admittedly hard to believe) hypothesis is wrong.
Fixes: 280035560
Test: ran a few hundred times without failures, though
I can't repro even without this change anyway
Change-Id: I620df32c43c855ca882e2e21201fe5b23b71a65a
1 file changed