Skip to content

Commit

Permalink
satellite/repair: extra logging during TestSegmentRepairPlacement
Browse files Browse the repository at this point in the history
In case we continue to see flaky TestSegmentRepairPlacement, this may
help narrow down the issue.

Change-Id: I34ca70e5bb33eca26e9940e845142121cc946ac0
  • Loading branch information
thepaul authored and Storj Robot committed Nov 1, 2023
1 parent b621a90 commit 51c930f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion satellite/repair/repairer/segments_test.go
Expand Up @@ -103,9 +103,17 @@ func TestSegmentRepairPlacement(t *testing.T) {

for index, piece := range segments[0].Pieces {
// make node offline if needed
require.NoError(t, updateNodeStatus(ctx, planet.Satellites[0], planet.FindNode(piece.StorageNode), index < tc.piecesOutOfPlacementOffline, defaultLocation))
node := planet.FindNode(piece.StorageNode)
if index < tc.piecesOutOfPlacementOffline {
t.Logf("marking node %s as offline", node.ID())
require.NoError(t, updateNodeStatus(ctx, planet.Satellites[0], node, true, defaultLocation))
} else {
t.Logf("marking node %s as online", node.ID())
require.NoError(t, updateNodeStatus(ctx, planet.Satellites[0], node, false, defaultLocation))
}

if index < tc.piecesOutOfPlacement {
t.Logf("marking node %s as out of placement", node.ID())
require.NoError(t, planet.Satellites[0].Overlay.Service.TestNodeCountryCode(ctx, piece.StorageNode, "US"))
}
}
Expand All @@ -121,10 +129,12 @@ func TestSegmentRepairPlacement(t *testing.T) {

require.NoError(t, planet.Satellites[0].Repairer.Overlay.DownloadSelectionCache.Refresh(ctx))

t.Log("starting repair")
_, err = planet.Satellites[0].Repairer.SegmentRepairer.Repair(ctx, &queue.InjuredSegment{
StreamID: segments[0].StreamID,
Position: segments[0].Position,
})
t.Log("repair complete")
require.NoError(t, err)

// confirm that all pieces have correct placement
Expand Down

0 comments on commit 51c930f

Please sign in to comment.