Skip to content

[CI] Sleep after EventHub.shared.start in API unit tests#369

Merged
kevinlind merged 1 commit intoadobe:devfrom
kevinlind:fix-api-unit-test
Jul 18, 2023
Merged

[CI] Sleep after EventHub.shared.start in API unit tests#369
kevinlind merged 1 commit intoadobe:devfrom
kevinlind:fix-api-unit-test

Conversation

@kevinlind
Copy link
Copy Markdown
Contributor

Description

Seeing test failures running EdgePublicAPITests unit test suite. Tests fail with an AEPError of timeout without executing test listener logic. It appears the MobileCore.registerEventListener call in the test cases is failing because the EventHub has not completed start up. Adding a short sleep after calling EventHub.shared.start gives the EventHub more time to startup before the tests execute.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@kevinlind kevinlind changed the title Sleep after EventHub.shared.start in API unit tests [CI] Sleep after EventHub.shared.start in API unit tests Jul 17, 2023
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 17, 2023

Codecov Report

Merging #369 (b43e2c8) into dev (8a2b1e7) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##              dev     #369   +/-   ##
=======================================
  Coverage   96.73%   96.73%           
=======================================
  Files          27       27           
  Lines        1653     1653           
=======================================
  Hits         1599     1599           
  Misses         54       54           

@kevinlind kevinlind requested a review from emdobrin July 17, 2023 22:56
Copy link
Copy Markdown
Contributor

@emdobrin emdobrin left a comment

Choose a reason for hiding this comment

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

Change looks good, but as a future enhancement for testing can we can get notified on start completion?

@kevinlind kevinlind merged commit bde2acf into adobe:dev Jul 18, 2023
@kevinlind kevinlind deleted the fix-api-unit-test branch July 18, 2023 17:10
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