diff options
author | Valery Piashchynski <[email protected]> | 2021-08-18 17:26:42 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2021-08-18 17:26:42 +0300 |
commit | 324407b3e2d779143be65872993c4d091abb1d38 (patch) | |
tree | e6f0bd64241ab2d4dc05809128c8e8d7d74cbcc4 /tests/plugins/reload | |
parent | a5435be8ab58bd23f1c2d3afd4484dd1d86b6002 (diff) | |
parent | eb70b89cb2f23ccd44b91bbcac7438a05a40c801 (diff) |
#764: feat(stat): `job` plugin drivers statistic
#764: feat(stat): `job` plugin drivers statistic
Diffstat (limited to 'tests/plugins/reload')
-rw-r--r-- | tests/plugins/reload/configs/.rr-reload-2.yaml | 2 | ||||
-rw-r--r-- | tests/plugins/reload/reload_plugin_test.go | 24 |
2 files changed, 16 insertions, 10 deletions
diff --git a/tests/plugins/reload/configs/.rr-reload-2.yaml b/tests/plugins/reload/configs/.rr-reload-2.yaml index fd1fe417..6a9d7582 100644 --- a/tests/plugins/reload/configs/.rr-reload-2.yaml +++ b/tests/plugins/reload/configs/.rr-reload-2.yaml @@ -27,7 +27,7 @@ logs: mode: development level: debug reload: - interval: 2s + interval: 1s patterns: - .txt services: diff --git a/tests/plugins/reload/reload_plugin_test.go b/tests/plugins/reload/reload_plugin_test.go index b5223b9c..21c27e49 100644 --- a/tests/plugins/reload/reload_plugin_test.go +++ b/tests/plugins/reload/reload_plugin_test.go @@ -50,11 +50,11 @@ func TestReloadInit(t *testing.T) { mockLogger.EXPECT().Debug("worker destructed", "pid", gomock.Any()).AnyTimes() mockLogger.EXPECT().Debug("worker constructed", "pid", gomock.Any()).AnyTimes() mockLogger.EXPECT().Debug("file was created", "path", gomock.Any(), "name", "file.txt", "size", gomock.Any()).MinTimes(1) - mockLogger.EXPECT().Debug("file was added to watcher", "path", gomock.Any(), "name", "file.txt", "size", gomock.Any()).Times(1) - mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").Times(1) - mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").Times(1) - mockLogger.EXPECT().Info("HTTP handler listeners successfully re-added").Times(1) - mockLogger.EXPECT().Info("HTTP plugin successfully restarted").Times(1) + mockLogger.EXPECT().Debug("file was added to watcher", "path", gomock.Any(), "name", "file.txt", "size", gomock.Any()).MinTimes(1) + mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").MinTimes(1) + mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").MinTimes(1) + mockLogger.EXPECT().Info("HTTP handler listeners successfully re-added").MinTimes(1) + mockLogger.EXPECT().Info("HTTP plugin successfully restarted").MinTimes(1) mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror err = cont.RegisterAll( @@ -258,10 +258,10 @@ func TestReloadFilterFileExt(t *testing.T) { mockLogger.EXPECT().Debug("file was created", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(100) mockLogger.EXPECT().Debug("file was added to watcher", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(1) mockLogger.EXPECT().Debug("file added to the list of removed files", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).AnyTimes() - mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").Times(1) - mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").Times(1) + mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").MinTimes(1) + mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").MinTimes(1) mockLogger.EXPECT().Info("HTTP handler listeners successfully re-added").MinTimes(1) - mockLogger.EXPECT().Info("HTTP plugin successfully restarted").Times(1) + mockLogger.EXPECT().Info("HTTP plugin successfully restarted").MinTimes(1) mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror err = cont.RegisterAll( @@ -317,6 +317,7 @@ func TestReloadFilterFileExt(t *testing.T) { time.Sleep(time.Second * 3) t.Run("ReloadMakeFiles", reloadMakeFiles) + time.Sleep(time.Second * 2) t.Run("ReloadFilteredExt", reloadFilteredExt) time.Sleep(time.Second * 10) @@ -460,10 +461,15 @@ func TestReloadCopy100(t *testing.T) { time.Sleep(time.Second * 3) t.Run("ReloadMake100Files", reloadMake100Files) + time.Sleep(time.Second * 2) t.Run("ReloadCopyFiles", reloadCopyFiles) + time.Sleep(time.Second * 2) t.Run("ReloadRecursiveDirsSupport", copyFilesRecursive) + time.Sleep(time.Second * 2) t.Run("RandomChangesInRecursiveDirs", randomChangesInRecursiveDirs) + time.Sleep(time.Second * 2) t.Run("RemoveFilesSupport", removeFilesSupport) + time.Sleep(time.Second * 2) t.Run("ReloadMoveSupport", reloadMoveSupport) time.Sleep(time.Second * 10) @@ -733,7 +739,7 @@ func TestReloadNoRecursion(t *testing.T) { time.Sleep(time.Second * 3) t.Run("ReloadMakeFiles", reloadMakeFiles) // make files in the testDir - time.Sleep(time.Second * 3) + time.Sleep(time.Second * 2) t.Run("ReloadCopyFilesRecursive", reloadCopyFiles) time.Sleep(time.Second * 3) assert.NoError(t, freeResources(testDir)) |