Skip to content

Fix extra exception when plug init fails.#745

Merged
arsharma1 merged 1 commit intogoogle:masterfrom
arsharma1:compat23
Mar 28, 2018
Merged

Fix extra exception when plug init fails.#745
arsharma1 merged 1 commit intogoogle:masterfrom
arsharma1:compat23

Conversation

@arsharma1
Copy link
Collaborator

@arsharma1 arsharma1 commented Mar 23, 2018

If there is an exception during plug initialization, the test record
outcome is never set for the console printing code in
_excecute_test_teardown to be called properly.

This required a few other changes:

  • In Phase Executor, don't set the stopping event if there is no
    current phase running.
  • In Test State, make sure _finalize always sets the test record
    outcome.
  • Add unit tests.

This change is Reviewable

# Exit early if plug initialization failed.
self.test_state.finalize_on_failed_plug_initialization(
phase_executor.ExceptionInfo(*sys.exc_info()))
return
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good, can we apply the same thing when running the test start?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@arsharma1 arsharma1 force-pushed the compat23 branch 2 times, most recently from 2b72ad7 to bded1a7 Compare March 28, 2018 19:12
#if not self.test_record.dut_id:
# raise BlankDutIdError(
# 'Blank or missing DUT ID, HTF requires a non-blank ID.')

Copy link
Contributor

Choose a reason for hiding this comment

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

un-comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, yes, trying to figure out why unit tests didn't work.

If there is an exception during plug initialization, the test record
outcome is never set for the console printing code in
_excecute_test_teardown to be called properly.

This required a few other changes:
* In Phase Executor, don't set the stopping event if there is no
current phase running.
* In Test State, make sure _finalize always sets the test record
outcome.
* Add unit tests.
@arsharma1 arsharma1 merged commit 43801d4 into google:master Mar 28, 2018
@arsharma1 arsharma1 deleted the compat23 branch March 28, 2018 22:45
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