diff options
author | Valery Piashchynski <[email protected]> | 2021-02-03 17:31:17 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-02-03 17:31:17 +0300 |
commit | 8eda5dc6f0f7e05d7b3d62e1861af05b49a2574a (patch) | |
tree | fae66ad49d2a4624a7caf45a5bf07d53e5c7d26f /tests | |
parent | 20a1a5d2eb26090e0eef0e6772330ee2a52526fa (diff) |
Fix memory leak in the Worker.go
Diffstat (limited to 'tests')
-rw-r--r-- | tests/composer.json | 5 | ||||
-rw-r--r-- | tests/plugins/reload/reload_plugin_test.go | 30 |
2 files changed, 18 insertions, 17 deletions
diff --git a/tests/composer.json b/tests/composer.json index 0cf74581..52fa3a0e 100644 --- a/tests/composer.json +++ b/tests/composer.json @@ -1,10 +1,11 @@ { - "minimum-stability": "dev", + "minimum-stability": "beta", "prefer-stable": true, "require": { "nyholm/psr7": "^1.3", "spiral/roadrunner": "^2.0", "spiral/roadrunner-http": "^2.0", - "temporal/sdk": "dev-master" + "temporal/sdk": ">=1.0", + "spiral/tokenizer": ">=2.7" } } diff --git a/tests/plugins/reload/reload_plugin_test.go b/tests/plugins/reload/reload_plugin_test.go index 9007541b..2e246480 100644 --- a/tests/plugins/reload/reload_plugin_test.go +++ b/tests/plugins/reload/reload_plugin_test.go @@ -358,7 +358,7 @@ func reloadFilteredExt(t *testing.T) { } // Should be events only about creating files with txt ext -func TestReloadCopy500(t *testing.T) { +func TestReloadCopy100(t *testing.T) { cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel)) assert.NoError(t, err) @@ -447,16 +447,16 @@ func TestReloadCopy500(t *testing.T) { // Scenario // 1 - // Create 3k files with txt, abc, def extensions + // Create 100 files with txt, abc, def extensions // Copy files to the unit_tests_copy dir // 2 // Delete both dirs, recreate - // Create 3k files with txt, abc, def extensions + // Create 100 files with txt, abc, def extensions // Move files to the unit_tests_copy dir // 3 // Recursive - t.Run("ReloadMake300Files", reloadMake300Files) + t.Run("ReloadMake100Files", reloadMake100Files) t.Run("ReloadCopyFiles", reloadCopyFiles) t.Run("ReloadRecursiveDirsSupport", copyFilesRecursive) t.Run("RandomChangesInRecursiveDirs", randomChangesInRecursiveDirs) @@ -478,9 +478,9 @@ func reloadMoveSupport(t *testing.T) { // rand sleep rSleep := rand.Int63n(500) // nolint:gosec time.Sleep(time.Millisecond * time.Duration(rSleep)) - rNum := rand.Int63n(int64(100)) // nolint:gosec - rDir := rand.Int63n(9) // nolint:gosec - rExt := rand.Int63n(3) // nolint:gosec + rNum := rand.Int63n(int64(33)) // nolint:gosec + rDir := rand.Int63n(9) // nolint:gosec + rExt := rand.Int63n(3) // nolint:gosec ext := []string{ ".txt", @@ -570,7 +570,7 @@ func randomChangesInRecursiveDirs(t *testing.T) { } for i := 0; i < 10; i++ { // rand sleep - rSleep := rand.Int63n(500) // nolint:gosec + rSleep := rand.Int63n(100) // nolint:gosec time.Sleep(time.Millisecond * time.Duration(rSleep)) rNum := rand.Int63n(int64(100)) // nolint:gosec rDir := rand.Int63n(10) // nolint:gosec @@ -616,13 +616,13 @@ func reloadCopyFiles(t *testing.T) { assert.NoError(t, os.Mkdir(testCopyToDir, 0755)) // recreate files - for i := uint(0); i < 100; i++ { + for i := uint(0); i < 33; i++ { assert.NoError(t, makeFile("file_"+strconv.Itoa(int(i))+".txt")) } - for i := uint(0); i < 100; i++ { + for i := uint(0); i < 33; i++ { assert.NoError(t, makeFile("file_"+strconv.Itoa(int(i))+".abc")) } - for i := uint(0); i < 100; i++ { + for i := uint(0); i < 34; i++ { assert.NoError(t, makeFile("file_"+strconv.Itoa(int(i))+".def")) } @@ -630,14 +630,14 @@ func reloadCopyFiles(t *testing.T) { assert.NoError(t, err) } -func reloadMake300Files(t *testing.T) { - for i := uint(0); i < 100; i++ { +func reloadMake100Files(t *testing.T) { + for i := uint(0); i < 33; i++ { assert.NoError(t, makeFile("file_"+strconv.Itoa(int(i))+".txt")) } - for i := uint(0); i < 100; i++ { + for i := uint(0); i < 33; i++ { assert.NoError(t, makeFile("file_"+strconv.Itoa(int(i))+".abc")) } - for i := uint(0); i < 100; i++ { + for i := uint(0); i < 34; i++ { assert.NoError(t, makeFile("file_"+strconv.Itoa(int(i))+".def")) } } |