MCPcopy Create free account
hub / github.com/wal-e/wal-e / test_fault_midstream

Function test_fault_midstream

tests/test_tar_upload_pool.py:65–83  ·  view source on GitHub ↗

Test if a previous upload fault is detected in calling .put. This case is seen while pipelining many uploads in excess of the maximum concurrency. NB: This test is critical as to prevent failed uploads from failing to notify a caller that the entire backup is incomplete.

()

Source from the content-addressed store, hash-verified

63
64
65def test_fault_midstream():
66 """Test if a previous upload fault is detected in calling .put.
67
68 This case is seen while pipelining many uploads in excess of the
69 maximum concurrency.
70
71 NB: This test is critical as to prevent failed uploads from
72 failing to notify a caller that the entire backup is incomplete.
73 """
74 pool = make_pool(1, 1)
75
76 # Set up upload doomed to fail.
77 tpart = FakeTarPartition(1, explosive=Explosion('Boom'))
78 pool.put(tpart)
79
80 # Try to receive the error through adding another upload.
81 tpart = FakeTarPartition(1)
82 with pytest.raises(Explosion):
83 pool.put(tpart)
84
85
86def test_fault_join():

Callers

nothing calls this directly

Calls 4

make_poolFunction · 0.85
FakeTarPartitionClass · 0.85
putMethod · 0.80
ExplosionClass · 0.70

Tested by

no test coverage detected