`retention.events` nor `retention.stats` is set, both take its value and a deprecation warning names them; when
either of them is set, `expiration` is ignored for both and the warning says so.
#### Scenario: Only expiration set
- **GIVEN** `expiration: 768h` and no `retention` block
- **WHEN** the server starts
- **THEN** `retention.events` and `retention.stats` are `32d`, the other retentions keep their defaults and a warning names `retention.events` and `retention.stats`
#### Scenario: Both set
- **GIVEN** `expiration: 768h` and `retention.events: 1d`
- **WHEN** the server starts
- **THEN** `retention.events` is `1d`, `retention.stats` keeps its default `7d` and a warning states that `expiration` is ignored
below 1h, above 2^31−1 s or not in whole seconds, `retention.entities` below 2d, `retention.rollups_daily` below
`rollups_hourly`, unknown `stats_detail` or `validation_action` or event type, a queue limit below 1000,
or a reconciler or migration limit out of range.
#### Scenario: Invalid interval
- **GIVEN** `interval: 500ms`
- **WHEN** the server starts
- **THEN** it exits with a message naming `openvidu.analytics.interval` and the allowed range
#### Scenario: Reconciler interval shorter than the batch interval
- **GIVEN** `interval: 10s` and `reconciler.interval: 5s`
- **WHEN** the server starts
- **THEN** it exits with a message naming `openvidu.analytics.reconciler.interval` and `openvidu.analytics.interval`
#### Scenario: Retention with a fraction of a second
- **GIVEN** `retention.events: 168h500ms`
- **WHEN** the server starts
- **THEN** it exits with a message naming `openvidu.analytics.retention.events` and requiring a whole number of seconds
#### Scenario: Retention above the TTL limit
- **GIVEN** `retention.rollups_hourly: 30000d`
- **WHEN** the server starts
- **THEN** it exits with a message naming `openvidu.analytics.retention.rollups_hourly` and the maximum `24855d3h14m7s` (2^31−1 seconds, the MongoDB TTL limit), before any database operation
#### Scenario: Entities retention too short for daily unique identities
- **GIVEN** `retention.entities: 1d`
- **WHEN** the server starts
- **THEN** it exits with a message naming `openvidu.analytics.retention.entities` and the minimum `2d`
#### Scenario: Daily rollups kept for less than hourly rollups
- **GIVEN** `retention.rollups_hourly: 400d` and `retention.rollups_daily: 365d`
- **WHEN** the server starts
- **THEN** it exits with a message naming `openvidu.analytics.retention.rollups_daily` and `openvidu.analytics.retention.rollups_hourly`
#### Scenario: Reconciler and migration limits
- **GIVEN** one of `reconciler.max_closures_per_run: 0`, `migration.rate: -1` or `migration.batch_size: 20000`
- **WHEN** the server starts
- **THEN** it exits with a message naming that key; the accepted values are `max_closures_per_run` at least 1, `rate` at least 0 and `batch_size` from 1 to 10000