@@ -1071,13 +1071,11 @@ func Test0boxGraphAndTotalEndpoints(testSetup *testing.T) {
10711071
10721072 targetBlobbers [0 ].Capacity += 10 * 1024 * 1024 * 1024
10731073 targetBlobbers [1 ].Capacity += 5 * 1024 * 1024 * 1024
1074- t .Logf ("Updating blobber 0 capacity to: %d" , targetBlobbers [0 ].Capacity )
10751074 apiClient .UpdateBlobber (t , blobberOwnerWallet , targetBlobbers [0 ], client .TxSuccessfulStatus )
10761075
10771076 // Update nonce before second update
10781077 blobberOwnerBalance = apiClient .GetWalletBalance (t , blobberOwnerWallet , client .HttpOkStatus )
10791078 blobberOwnerWallet .Nonce = int (blobberOwnerBalance .Nonce )
1080- t .Logf ("Updating blobber 1 capacity to: %d" , targetBlobbers [1 ].Capacity )
10811079 apiClient .UpdateBlobber (t , blobberOwnerWallet , targetBlobbers [1 ], client .TxSuccessfulStatus )
10821080
10831081 // Check increase
@@ -1086,12 +1084,8 @@ func Test0boxGraphAndTotalEndpoints(testSetup *testing.T) {
10861084 require .NoError (t , err )
10871085 require .Equal (t , 200 , resp .StatusCode ())
10881086 totalBlobberCapacityAfter := int64 (* data )
1089- t .Logf ("Current total capacity: %d, expected > %d" , totalBlobberCapacityAfter , totalBlobberCapacity )
10901087 cond := totalBlobberCapacityAfter > totalBlobberCapacity
1091- if cond {
1092- totalBlobberCapacity = totalBlobberCapacityAfter
1093- t .Logf ("Total capacity increased successfully to: %d" , totalBlobberCapacity )
1094- }
1088+ totalBlobberCapacity = totalBlobberCapacityAfter
10951089 return cond
10961090 })
10971091
@@ -1103,36 +1097,26 @@ func Test0boxGraphAndTotalEndpoints(testSetup *testing.T) {
11031097
11041098 targetBlobbers [0 ].Capacity -= 10 * 1024 * 1024 * 1024
11051099 targetBlobbers [1 ].Capacity -= 5 * 1024 * 1024 * 1024
1106- t .Logf ("Updating blobber 0 capacity back to: %d" , targetBlobbers [0 ].Capacity )
11071100 apiClient .UpdateBlobber (t , blobberOwnerWallet , targetBlobbers [0 ], client .TxSuccessfulStatus )
11081101
11091102 // Update nonce before second decrease
11101103 blobberOwnerBalance = apiClient .GetWalletBalance (t , blobberOwnerWallet , client .HttpOkStatus )
11111104 blobberOwnerWallet .Nonce = int (blobberOwnerBalance .Nonce )
1112- t .Logf ("Updating blobber 1 capacity back to: %d" , targetBlobbers [1 ].Capacity )
11131105 apiClient .UpdateBlobber (t , blobberOwnerWallet , targetBlobbers [1 ], client .TxSuccessfulStatus )
11141106
1115- // Check decrease - allow for small differences due to timing/rounding
1107+ // Check decrease
11161108 wait .PoolImmediately (t , 2 * time .Minute , func () bool {
11171109 data , resp , err := zboxClient .GetTotalBlobberCapacity (t )
11181110 require .NoError (t , err )
11191111 require .Equal (t , 200 , resp .StatusCode ())
11201112 totalBlobberCapacityAfter := int64 (* data )
1113+ totalBlobberCapacity = totalBlobberCapacityAfter
11211114
11221115 blobbers , resp , err := apiClient .V1SCRestGetAllBlobbers (t , client .HttpOkStatus )
11231116 require .NoError (t , err )
11241117 require .Equal (t , 200 , resp .StatusCode ())
11251118 expectedCapacity := calculateCapacity (blobbers )
1126- diff := expectedCapacity - totalBlobberCapacityAfter
1127- if diff < 0 {
1128- diff = - diff
1129- }
1130- // Allow for small differences (within 1GB) due to timing/rounding in graph aggregation
1131- cond := diff <= 1024 * 1024 * 1024
1132- t .Logf ("Total capacity from API: %d, calculated from blobbers: %d, difference: %d" , totalBlobberCapacityAfter , expectedCapacity , diff )
1133- if cond {
1134- t .Logf ("Total capacity matches expected value (within tolerance)" )
1135- }
1119+ cond := expectedCapacity == totalBlobberCapacityAfter
11361120 return cond
11371121 })
11381122 })
@@ -1326,7 +1310,6 @@ func Test0boxGraphBlobberEndpoints(testSetup *testing.T) {
13261310
13271311 // Increase capacity
13281312 targetBlobber .Capacity += 1000000000
1329- t .Logf ("Updating blobber capacity to: %d" , targetBlobber .Capacity )
13301313 apiClient .UpdateBlobber (t , blobberOwnerWallet , targetBlobber , client .TxSuccessfulStatus )
13311314
13321315 // Check increased for the same blobber
@@ -1336,11 +1319,9 @@ func Test0boxGraphBlobberEndpoints(testSetup *testing.T) {
13361319 require .Equal (t , 200 , resp .StatusCode ())
13371320 require .Len (t , * data , 1 )
13381321 afterValue := (* data )[0 ]
1339- t .Logf ("Current capacity: %d, expected > %d" , afterValue , capacity )
13401322 cond := afterValue > capacity
13411323 if cond {
13421324 capacity = afterValue
1343- t .Logf ("Capacity increased successfully to: %d" , capacity )
13441325 }
13451326 return cond
13461327 })
@@ -1352,7 +1333,6 @@ func Test0boxGraphBlobberEndpoints(testSetup *testing.T) {
13521333 require .GreaterOrEqual (t , blobberOwnerBalance .Balance , int64 (200000000 ), "blobberOwnerWallet must have at least 0.2 ZCN to pay for update transaction (0.1 ZCN value + fees)" )
13531334
13541335 targetBlobber .Capacity -= 1000000000
1355- t .Logf ("Updating blobber capacity back to: %d" , targetBlobber .Capacity )
13561336 apiClient .UpdateBlobber (t , blobberOwnerWallet , targetBlobber , client .TxSuccessfulStatus )
13571337
13581338 // Check decreased for the same blobber
@@ -1362,11 +1342,9 @@ func Test0boxGraphBlobberEndpoints(testSetup *testing.T) {
13621342 require .Equal (t , 200 , resp .StatusCode ())
13631343 require .Len (t , * data , 1 )
13641344 afterValue := (* data )[0 ]
1365- t .Logf ("Current capacity: %d, expected < %d" , afterValue , capacity )
13661345 cond := afterValue < capacity
13671346 if cond {
13681347 capacity = afterValue
1369- t .Logf ("Capacity decreased successfully to: %d" , capacity )
13701348 }
13711349 return cond
13721350 })
0 commit comments