Merge lp:~mwhudson/lava-dispatcher/wait-for-console-for-lava_test_shell-bug-1073899 into lp:lava-dispatcher

Proposed by Michael Hudson-Doyle
Status: Rejected
Rejected by: Paul Sokolovsky
Proposed branch: lp:~mwhudson/lava-dispatcher/wait-for-console-for-lava_test_shell-bug-1073899
Merge into: lp:lava-dispatcher
Diff against target: 13 lines (+3/-0)
1 file modified
lava_dispatcher/device/target.py (+3/-0)
To merge this branch: bzr merge lp:~mwhudson/lava-dispatcher/wait-for-console-for-lava_test_shell-bug-1073899
Reviewer Review Type Date Requested Status
Paul Sokolovsky Approve
Dave Pigott Approve
Review via email: mp+132976@code.launchpad.net

Description of the change

The name of the branch is a fair description. Not yet tested, hopefully soon.

To post a comment you must log in.
435. By Michael Hudson-Doyle

oops, remember how upstart works

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hm, even with the fix, this doesn't quite work -- lava-test-runner starts when the auto-serial-console script *starts*, which is not when the prompt appears. I guess if we really want to delay starting the test runner until the shell is accepting commands, we should just wait for the prompt... but that seems like an admission of defeat.

436. By Michael Hudson-Doyle

a different approach: call run("true") (and so wait for a prompt) before run("sync") in power_off()

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Tried something else. Seems to work.

Revision history for this message
Dave Pigott (dpigott) wrote :

Makes sense. +1

review: Approve
Revision history for this message
Andy Doan (doanac) wrote :

Can you elaborate on why you moved away from the original upstart .conf changes? Also, do we need a timeout specified with the runner.run('true') command?

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Andy Doan <email address hidden> writes:

> Can you elaborate on why you moved away from the original upstart
> .conf changes?

https://code.launchpad.net/~mwhudson/lava-dispatcher/wait-for-console-for-lava_test_shell-bug-1073899/+merge/132976/comments/286075

> Also, do we need a timeout specified with the runner.run('true') command?

Maybe. Not sure what a good timeout would be -- I guess 30 s or so
would be safe enough.

Cheers,
mwh

Revision history for this message
Paul Sokolovsky (pfalcon) wrote :

I have to say that we tried different approaches trying to find "good" solution to this issue with James, but we tried to add extra commands (halt, etc.) *after* sync. I already prepared to submit "sleep" patch, but tried this one, and it works as expected over bunch of run I did. Please merge!

review: Approve
Revision history for this message
Andy Doan (doanac) wrote :

Michael and I discussed this yesterday and basically our new power_off logic is turning into a mess. I'm testing a quick patch right now that restores some sanity to this by making sure lava-test-shell just calls sync before it exits. That then solves the issue for all targets.

Revision history for this message
Paul Sokolovsky (pfalcon) wrote :

Ok, this hangs in queue for too long, and based on last comment, should have been fixed in another way long ago. Unless comments follow, I'm going to close this as rejected tomorrow.

Unmerged revisions

436. By Michael Hudson-Doyle

a different approach: call run("true") (and so wait for a prompt) before run("sync") in power_off()

435. By Michael Hudson-Doyle

oops, remember how upstart works

434. By Michael Hudson-Doyle

do not start lava-test-shell until the root shell on the serial console has started

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_dispatcher/device/target.py'
2--- lava_dispatcher/device/target.py 2012-10-29 21:03:29 +0000
3+++ lava_dispatcher/device/target.py 2012-11-06 01:13:21 +0000
4@@ -107,6 +107,9 @@
5 runner = self._get_runner(proc)
6 try:
7 logging.info('attempting a filesystem sync before power_off')
8+ # We call run('true') first to ensure that we have a shell prompt
9+ # to send the 'sync' command to.
10+ runner.run('true')
11 runner.run('sync', timeout=20)
12 except:
13 logging.exception('calling sync failed')

Subscribers

People subscribed via source and target branches