Skip to content

Reuse context from 'find_first_device_or_exit()' & hw reset test stability improvment - #13177

Merged
Nir-Az merged 5 commits into
realsenseai:developmentfrom
AviaAv:hw-reset-improve
Jul 23, 2024
Merged

Reuse context from 'find_first_device_or_exit()' & hw reset test stability improvment#13177
Nir-Az merged 5 commits into
realsenseai:developmentfrom
AviaAv:hw-reset-improve

Conversation

@AviaAv

@AviaAv AviaAv commented Jul 22, 2024

Copy link
Copy Markdown
Contributor

Tracked on: [LRS-1170]

@AviaAv
AviaAv requested a review from Nir-Az July 22, 2024 06:58

ctx = rs.context()
device = test.find_first_device_or_exit();
device, ctx = test.find_first_device_or_exit();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please try using this when not using both params.
image

dev, ctx = test.find_first_device_or_exit()
ctx.set_devices_changed_callback( device_changed )
log.out( "Sending HW-reset command" )
time.sleep(1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please shift this line about the comment
Something like:

# allowing some time for the system to stabilize
time.sleep(1)

log.out( "Sending HW-reset command" )
dev.hardware_reset()


max_dev_enum_time = get_max_enum_rime_by_device( dev )
log.out( "Sending HW-reset command" )
time.sleep(1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as before

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@Nir-Az
Nir-Az merged commit fc68a9d into realsenseai:development Jul 23, 2024
@maloel

maloel commented Jul 23, 2024

Copy link
Copy Markdown
Contributor

We really need to work on our descriptions...

@maloel

maloel commented Jul 23, 2024

Copy link
Copy Markdown
Contributor

What's the sleep for?

@AviaAv AviaAv changed the title Update find_first_device_or_exit - hw reset test improve Reuse context from 'find_first_device_or_exit()' & hw reset test stability improvment Jul 23, 2024
@Nir-Az

Nir-Az commented Jul 23, 2024

Copy link
Copy Markdown
Collaborator

What's the sleep for?

Trying to make the LibCI tests more robust.
Doing HW reset that fast after enumeration can sometimes fail, we see it more on SC and investigate it with them.
But that's not a common use case that after enumeration the user will command a HW-reset, so we ease it on the unit tests.

@AviaAv
AviaAv deleted the hw-reset-improve branch June 1, 2026 10:51
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.

3 participants