(t *testing.T)
| 22 | } |
| 23 | |
| 24 | func TestGCandDump(t *testing.T) { |
| 25 | var ( |
| 26 | bucketStore = NewBucketStore() |
| 27 | ctx = t.Context() |
| 28 | ) |
| 29 | |
| 30 | Holders := []BucketFactory{ |
| 31 | // one overflowing soon + bh |
| 32 | { |
| 33 | Spec: BucketSpec{ |
| 34 | Name: "test_counter_fast", |
| 35 | Description: "test_counter_fast", |
| 36 | Debug: true, |
| 37 | Type: "counter", |
| 38 | Capacity: -1, |
| 39 | Duration: "0.5s", |
| 40 | Blackhole: "1m", |
| 41 | Filter: "true", |
| 42 | }, |
| 43 | }, |
| 44 | // one long counter |
| 45 | { |
| 46 | Spec: BucketSpec{ |
| 47 | Name: "test_counter_slow", |
| 48 | Description: "test_counter_slow", |
| 49 | Debug: true, |
| 50 | Type: "counter", |
| 51 | Capacity: -1, |
| 52 | Duration: "10m", |
| 53 | Filter: "true", |
| 54 | }, |
| 55 | }, |
| 56 | // slow leaky |
| 57 | { |
| 58 | Spec: BucketSpec{ |
| 59 | Name: "test_leaky_slow", |
| 60 | Description: "test_leaky_slow", |
| 61 | Debug: true, |
| 62 | Type: "leaky", |
| 63 | Capacity: 5, |
| 64 | LeakSpeed: "10m", |
| 65 | Filter: "true", |
| 66 | }, |
| 67 | }, |
| 68 | } |
| 69 | |
| 70 | for idx := range Holders { |
| 71 | if err := Holders[idx].LoadBucket(); err != nil { |
| 72 | t.Fatalf("while loading (%d/%d): %s", idx, len(Holders), err) |
| 73 | } |
| 74 | |
| 75 | if err := Holders[idx].Validate(); err != nil { |
| 76 | t.Fatalf("while validating (%d/%d): %s", idx, len(Holders), err) |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | log.Info("Pouring to bucket") |
| 81 |
nothing calls this directly
no test coverage detected
searching dependent graphs…