Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Test] Wait for sendEvent to return before continuing functional test. #370

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

kevinlind
Copy link
Contributor

Description

Fix failures from AEPEdgeFunctionalTests.testSendEvent_edgeNetworkResponseContainsLocationHint_sendEventDoesNotIncludeExpiredLocationHint()

This test sends two Edge.sendEvent() calls with a sleep between the two calls. The first sendEvent() will receive a location hint value with a 1 second timeout and the second sendEvent() is expected to not include the location hint as it expired. The test is failing because the second Edge.sendEvent() call contains the location hint when it is expected not to.

Looking at the logs it appears the execution of the first sendEvent() may take a second or so to complete, however the test thread is paused immediately after the api call. It appears the test thread is waking before the location hint expires because the sendEvent() call is taking longer than expected.

Fix by adding a completion callback closure to the first sendEvent() call so the test thread sleep does not start until after the first sendEvent() call completes.

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 Wait for sendEvent to return before continuing functional test. [Test] Wait for sendEvent to return before continuing functional test. Jul 18, 2023
@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #370 (f95f15b) into dev (bde2acf) will not change coverage.
The diff coverage is n/a.

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

@emdobrin emdobrin merged commit 2bf8b01 into adobe:dev Jul 18, 2023
@kevinlind kevinlind deleted the fix-test-doesnotincludelocationhint branch July 18, 2023 22:43
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants