MM-14143 config cleanup final (#10374)
* TestGetLicenseFileFromDisk: avoid using fileutils.FindConfigFile * config: abstract config-related file access, extend memory store * simplify config validate to avoid file knowledge * fix relative file tests * cluster: fix ConfigChanged event The old and new configurations were swapped when notifying the enterprise code of configuration changes, creating needless instability in propagating config updates across a cluster. * config/database: ignore duplicates * test cleanup * remove unnecessary Save() in test
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3716918c57
Коммит
1e462da2d4
@@ -34,10 +34,16 @@ func TestStartServerSuccess(t *testing.T) {
|
||||
|
||||
func TestStartServerRateLimiterCriticalError(t *testing.T) {
|
||||
// Attempt to use Rate Limiter with an invalid config
|
||||
ms, err := config.NewMemoryStore(true)
|
||||
ms, err := config.NewMemoryStoreWithOptions(&config.MemoryStoreOptions{
|
||||
SkipValidation: true,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
config := ms.Get()
|
||||
*config.RateLimitSettings.Enable = true
|
||||
*config.RateLimitSettings.MaxBurst = -100
|
||||
_, err = ms.Set(config)
|
||||
require.NoError(t, err)
|
||||
*ms.Config.RateLimitSettings.Enable = true
|
||||
*ms.Config.RateLimitSettings.MaxBurst = -100
|
||||
|
||||
s, err := NewServer(ConfigStore(ms))
|
||||
require.NoError(t, err)
|
||||
|
||||
Ссылка в новой задаче
Block a user