-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgc.feature
60 lines (56 loc) · 1.94 KB
/
gc.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Feature: Garbage Collection
Obsolete session data should be removed as soon as possible, but not instantly.
Garbage collection can be run on a scheduler by a task scheduler.
Garbage collection can run from time to time based on probability.
Scenario: Garbage should remain until collected
Given there is garbage to collect
| id | last_modified |
| 1 | -3 week |
| 2 | -2 week |
| 3 | -1 week |
| 4 | -3 day |
| 5 | -2 day |
| 6 | -1 day |
| 7 | -3 hour |
| 8 | -2 hour |
| 9 | -1 hour |
| 10 | -3 minute |
Given garbage collection is disabled
When session is started
Then garbage should remain
Scenario: Run garbage collection on a schedule
Given there is garbage to collect
| id | last_modified |
| 1 | -3 week |
| 2 | -2 week |
| 3 | -1 week |
| 4 | -3 day |
| 5 | -2 day |
| 6 | -1 day |
| 7 | -3 hour |
| 8 | -2 hour |
| 9 | -1 hour |
| 10 | -3 minute |
When garbage collection is run
Then garbage should be collected
Scenario Outline: Run garbage collection from time to time
Given there is garbage to collect
| id | last_modified |
| 1 | -3 week |
| 2 | -2 week |
| 3 | -1 week |
| 4 | -3 day |
| 5 | -2 day |
| 6 | -1 day |
| 7 | -3 hour |
| 8 | -2 hour |
| 9 | -1 hour |
| 10 | -3 minute |
And probability is set to <probability> / <divisor>
When session is started <requests> times
Then prior garbage should be collected
Examples:
| probability | divisor | requests |
| 1 | 1 | 1 |
| 1 | 2 | 10 |
| 1 | 10 | 100 |