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

add blind wait for flasher image when we can't detect state #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rcooke-warwick
Copy link
Collaborator

@rcooke-warwick rcooke-warwick commented Apr 17, 2024

There exist some cases where we:

  • can't detect the state of the DUT while booted into the flasher image, so can't reliably determine if the flasher image is finished
  • the DUT doesn't power down after the flasher image is finished - due to the boards design

This PR adds a workaround, using the FLASHER_IMAGE_WAIT env var, you can specify in ms a period to wait for the flasher image to flash the DUT internal storage, and then hope it's done.

Change-type: patch

Copy link
Contributor

@vipulgupta2048 vipulgupta2048 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions to console log message only. Logic seems fine.

}
console.log('Internally flashed - powering off DUT');
} else {
console.log(`Blindly waiting for DUT to interally flash - waiting for a period of ${BLIND_WAIT}... and hoping`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log(`Blindly waiting for DUT to interally flash - waiting for a period of ${BLIND_WAIT}... and hoping`)
console.log(`There is no way to know if DUT has been flashed. Hence, waiting for DUT to complete flashing process internally for a period of ${BLIND_WAIT / 1000} seconds`)

More positive console log message with a little more information and hope. Also, spelling fix

if(BLIND_WAIT === false){
while (dutOn) {
await delay(1000 * 10); // 10 seconds between checks
console.log(`waiting for DUT to be off`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log(`waiting for DUT to be off`);
console.log(`Checking if DUT has turned off by now`);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT, optional

// occasionally the DUT might appear to be powered down, but it isn't - we want to confirm that the DUT has stayed off for an interval of time
if (!dutOn) {
let offCount = 0;
console.log(`detected DUT has powered off - confirming...`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log(`detected DUT has powered off - confirming...`);
console.log(`DUT power off detected: confirming ...`);

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

Successfully merging this pull request may close these issues.

2 participants