Ensure discovery tests run against postgres (#1230)

This commit is contained in:
Egon Elbre 2019-02-05 19:03:16 +02:00 committed by GitHub
parent 3c73d3a33c
commit b16f27c54b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,23 +14,17 @@ import (
)
func TestCache_Refresh(t *testing.T) {
ctx := testcontext.New(t)
defer ctx.Cleanup()
testplanet.Run(t, testplanet.Config{
SatelliteCount: 1, StorageNodeCount: 10, UplinkCount: 0,
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
time.Sleep(5 * time.Second)
planet, err := testplanet.New(t, 1, 10, 0)
if err != nil {
t.Fatal(err)
}
defer ctx.Check(planet.Shutdown)
planet.Start(ctx)
time.Sleep(5 * time.Second)
satellite := planet.Satellites[0]
for _, storageNode := range planet.StorageNodes {
node, err := satellite.Overlay.Service.Get(ctx, storageNode.ID())
if assert.NoError(t, err) {
assert.Equal(t, storageNode.Addr(), node.Address.Address)
satellite := planet.Satellites[0]
for _, storageNode := range planet.StorageNodes {
node, err := satellite.Overlay.Service.Get(ctx, storageNode.ID())
if assert.NoError(t, err) {
assert.Equal(t, storageNode.Addr(), node.Address.Address)
}
}
}
})
}