summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-20 16:48:49 +0300
committerValery Piashchynski <[email protected]>2020-12-20 16:48:49 +0300
commit349088db2081704e15699ce1e6f6b1f8898bd336 (patch)
treef6bcbfd6c6fa204be11a7eda442eeadd6cf5426d /plugins
parent9d2bb93b3341471a084482f7bd41cac543f95cb2 (diff)
Remove reloadLiveAfterHTTP
Diffstat (limited to 'plugins')
-rw-r--r--plugins/reload/tests/reload_plugin_test.go26
1 files changed, 0 insertions, 26 deletions
diff --git a/plugins/reload/tests/reload_plugin_test.go b/plugins/reload/tests/reload_plugin_test.go
index 4d60c146..2ba9e256 100644
--- a/plugins/reload/tests/reload_plugin_test.go
+++ b/plugins/reload/tests/reload_plugin_test.go
@@ -4,7 +4,6 @@ import (
"io"
"io/ioutil"
"math/rand"
- "net/http"
"os"
"os/signal"
"path/filepath"
@@ -108,7 +107,6 @@ func TestReloadInit(t *testing.T) {
}()
t.Run("ReloadTestInit", reloadTestInit)
- reloadHTTPLiveAfterReset(t, "22388")
wg.Wait()
assert.NoError(t, freeResources(testDir))
@@ -203,7 +201,6 @@ func TestReloadHugeNumberOfFiles(t *testing.T) {
t.Run("ReloadTestHugeNumberOfFiles", reloadHugeNumberOfFiles)
t.Run("ReloadRandomlyChangeFile", randomlyChangeFile)
- reloadHTTPLiveAfterReset(t, "22388")
wg.Wait()
assert.NoError(t, freeResources(testDir))
@@ -308,7 +305,6 @@ func TestReloadFilterFileExt(t *testing.T) {
t.Run("ReloadMakeFiles", reloadMakeFiles)
t.Run("ReloadFilteredExt", reloadFilteredExt)
- reloadHTTPLiveAfterReset(t, "27388")
wg.Wait()
@@ -452,8 +448,6 @@ func TestReloadCopy500(t *testing.T) {
t.Run("RemoveFilesSupport", removeFilesSupport)
t.Run("ReloadMoveSupport", reloadMoveSupport)
- reloadHTTPLiveAfterReset(t, "37388")
-
assert.NoError(t, freeResources(testDir))
assert.NoError(t, freeResources(testCopyToDir))
assert.NoError(t, freeResources(dir1))
@@ -710,7 +704,6 @@ func TestReloadNoRecursion(t *testing.T) {
t.Run("ReloadMakeFiles", reloadMakeFiles) // make files in the testDir
t.Run("ReloadCopyFilesRecursive", reloadCopyFiles)
- reloadHTTPLiveAfterReset(t, "22766")
wg.Wait()
assert.NoError(t, freeResources(testDir))
@@ -720,25 +713,6 @@ func TestReloadNoRecursion(t *testing.T) {
// ========================================================================
-func reloadHTTPLiveAfterReset(t *testing.T, port string) {
- req, err := http.NewRequest("GET", "http://localhost:"+port, nil)
- assert.NoError(t, err)
-
- r, err := http.DefaultClient.Do(req)
- if err != nil {
- t.Fatal(err)
- }
-
- b, err := ioutil.ReadAll(r.Body)
- assert.NoError(t, err)
-
- assert.Equal(t, 200, r.StatusCode)
- assert.Equal(t, "hello world", string(b))
-
- err = r.Body.Close()
- assert.NoError(t, err)
-}
-
func freeResources(path string) error {
return os.RemoveAll(path)
}