This is the happy path with everything working
(t *testing.T)
| 289 | |
| 290 | // This is the happy path with everything working |
| 291 | func TestWriteBackAddOK(t *testing.T) { |
| 292 | wb, cancel := newTestWriteBack(t) |
| 293 | defer cancel() |
| 294 | |
| 295 | pi := newPutItem(t) |
| 296 | |
| 297 | var inID Handle |
| 298 | wb.SetID(&inID) |
| 299 | assert.Equal(t, Handle(1), inID) |
| 300 | |
| 301 | id := wb.Add(inID, "one", 10, true, pi.put) |
| 302 | assert.Equal(t, inID, id) |
| 303 | wbItem := wb.lookup[id] |
| 304 | checkOnHeap(t, wb, wbItem) |
| 305 | checkInLookup(t, wb, wbItem) |
| 306 | assert.Equal(t, "one", wb.string(t)) |
| 307 | |
| 308 | <-pi.started |
| 309 | checkNotOnHeap(t, wb, wbItem) |
| 310 | checkInLookup(t, wb, wbItem) |
| 311 | |
| 312 | pi.finish(nil) // transfer successful |
| 313 | waitUntilNoTransfers(t, wb) |
| 314 | checkNotOnHeap(t, wb, wbItem) |
| 315 | checkNotInLookup(t, wb, wbItem) |
| 316 | } |
| 317 | |
| 318 | // Now test the upload failing and being retried |
| 319 | func TestWriteBackAddFailRetry(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…