Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci/tests: failed_state_test.go might need to allow additional state #167

Open
unakatsuo opened this issue May 22, 2017 · 1 comment
Open

Comments

@unakatsuo
Copy link
Contributor

unakatsuo commented May 22, 2017

https://ci.openvdc.org/blue/rest/organizations/jenkins/pipelines/citest/branches/master/runs/179/nodes/36/log/

got an error

=== RUN   TestFailedState_RebootInstance
--- FAIL: TestFailedState_RebootInstance (5.21s)
	00_run_cmd.go:115: Unexpected Instance State: i-0000000009 goal=FAILED found=RUNNING

Each scenario in the file waits for FAILED state with transitional states. But the failure is detected since the origin state is not added to WaitInstance(). Possible symptom is:

  1. Once the instance became RUNNING, openvdc reboot is issued.
  2. The command is not reached to the executor yet so the state is kept to RUNNING.
  3. The first attempt from WaitInstance() sees RUNNING but it is not listed as intermidiate states like []string{"REBOOTING"}
func TestFailedState_RebootInstance(t *testing.T) {
	stdout, _ := RunCmdAndReportFail(t, "openvdc", "run", "centos/7/null", `{"crash_stage": "reboot"}`)
	instance_id := strings.TrimSpace(stdout.String())

	WaitInstance(t, 5*time.Minute, instance_id, "RUNNING", []string{"QUEUED", "STARTING"})
	RunCmdAndReportFail(t, "openvdc", "reboot", instance_id)
	WaitInstance(t, 5*time.Minute, instance_id, "FAILED", []string{"REBOOTING"})
}
@unakatsuo
Copy link
Contributor Author

The executor crashed as expected

May 22 09:21:16 executor-null vdc-executor[11016]: 2017-05-22 09:21:16 [ERROR] openvdc-executor/main.go:436 Failed to reboot instance Error: Emulate crash at RebootInstance
                                                   ErrorStackTrace:
                                                   github.com/axsh/openvdc/hypervisor/null.(*NullHypervisorDriver).RebootInstance
                                                           /var/tmp/go/src/github.com/axsh/openvdc/hypervisor/null/null.go:85
                                                   main.(*VDCExecutor).rebootInstance
                                                           /var/tmp/go/src/github.com/axsh/openvdc/cmd/openvdc-executor/main.go:317
                                                   main.(*VDCExecutor).FrameworkMessage
                                                           /var/tmp/go/src/github.com/axsh/openvdc/cmd/openvdc-executor/main.go:416
                                                   github.com/axsh/openvdc/vendor/github.com/mesos/mesos-go/executor.(*MesosExecutorDriver).frameworkMessage.func1
                                                           /var/tmp/go/src/github.com/axsh/openvdc/vendor/github.com/mesos/mesos-go/executor/executor.go:481
                                                   github.com/axsh/openvdc/vendor/github.com/mesos/mesos-go/executor.NewMesosExecutorDriver.func2.1
                                                           /var/tmp/go/src/github.com/axsh/openvdc/vendor/github.com/mesos/mesos-go/executor/executor.go:112
                                                   runtime.goexit
                                                           /usr/lib/golang/src/runtime/asm_amd64.s:2086

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants