Skip to content

Commit

Permalink
Merge pull request #5 from singnet/decrease-timeout
Browse files Browse the repository at this point in the history
Use 1-second poll time for integration test
  • Loading branch information
Eric Kearns authored Jul 18, 2018
2 parents 5d69a4d + b4efb91 commit e042c34
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resources/test/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var testConfiguration = []string{
"SNET_HDWALLET_INDEX=0",
"SNET_LOG_LEVEL=5",
"SNET_PASSTHROUGH_ENABLED=false",
"SNET_POLL_SLEEP_SECS=5",
"SNET_POLL_SLEEP_SECS=1",
"SNET_SERVICE_TYPE=grpc",
"SMET_WIRE_ENCODING=json",
}
Expand Down Expand Up @@ -95,7 +95,7 @@ func TestEndToEnd(t *testing.T) {
snetdCmd := runCommand("", testConfiguration, filepath.Join(buildPath, "snetd"))
defer snetdCmd.Wait()
defer snetdCmd.Process.Signal(syscall.SIGTERM)
time.Sleep(time.Second * 7)
time.Sleep(2 * time.Second)

runCommand(blockchainPath, nil, "npm", "run", "create-job").Wait()
runCommand(blockchainPath, nil, "npm", "run", "fund-job").Wait()
Expand All @@ -114,7 +114,7 @@ func TestEndToEnd(t *testing.T) {
err = json.Unmarshal(rawJobInvocation, jIFile)
require.NoError(t, err)

time.Sleep(time.Second * 7)
time.Sleep(2 * time.Second)

httpReq, err := http.NewRequest("POST", "http://127.0.0.1:5000/FakeService/FakeMethod",
bytes.NewBuffer([]byte("\x00\x00\x00\x00\x13"+`{"hello":"goodbye"}`)))
Expand All @@ -137,7 +137,7 @@ func TestEndToEnd(t *testing.T) {
fmt.Print(string(httpRespBytes))
assert.NotEmpty(t, httpRespBytes, "Expected response body from daemon")

time.Sleep(time.Second * 7)
time.Sleep(2 * time.Second)
}

func runCommand(dir string, env []string, name string, arg ...string) *exec.Cmd {
Expand Down

0 comments on commit e042c34

Please sign in to comment.