Skip to content

Fix TestBase timeout#1099

Merged
timkimadobe merged 2 commits intoadobe:dev-testutilsfrom
timkimadobe:fix-testbase-timeout
Oct 28, 2024
Merged

Fix TestBase timeout#1099
timkimadobe merged 2 commits intoadobe:dev-testutilsfrom
timkimadobe:fix-testbase-timeout

Conversation

@timkimadobe
Copy link
Copy Markdown
Contributor

@timkimadobe timkimadobe commented Oct 25, 2024

Important

This change will bump AEPTestUtils from 5.2.1 -> 5.2.2

Description

This PR fixes TestBase method getDispatchedEventsWith(type:source:timeout:file:line:) to respect the provided timeout value in both cases (when event expectation does or doesnt exist for a given event type and source).

It also updates the method documentation for some methods.

Related Issue

This Edge iOS integration test failed because the default timeout did not allow enough time for event processing before moving on to assertion. Without the change in this PR, there is also no way to configure the non-expected event timeout period.

Notice in the following logs, that the expected Edge error response IS dispatched, but there the timeout triggers too quickly and the assertion fails:

Logs archive

2024-10-24T19:26:07.3355670Z 2024-10-24 19:26:00.232498+0000 xctest[3685:21077] [AEP SDK TRACE - ] Processed Event #Optional(9) -     [
2024-10-24T19:26:07.3356490Z       id: 92578887-5CA7-47EB-B5C9-FCF1ED7791E2
2024-10-24T19:26:07.3356800Z       name: AEP Error Response
2024-10-24T19:26:07.3357070Z       type: com.adobe.eventType.edge
2024-10-24T19:26:07.3357440Z       source: com.adobe.eventSource.errorResponseContent
2024-10-24T19:26:07.3357770Z       data: {
2024-10-24T19:26:07.3358000Z   "title" : "Invalid datastream ID",
2024-10-24T19:26:07.3358300Z   "status" : 400,
2024-10-24T19:26:07.3358670Z   "requestEventId" : "30869B89-5397-4B19-97D7-1335F5218A55",
2024-10-24T19:26:07.3359090Z   "report" : {
2024-10-24T19:26:07.3359470Z     "requestId" : "C21A14E1-61A4-46EC-B08C-552C08B78FEB"
2024-10-24T19:26:07.3359800Z   },
2024-10-24T19:26:07.3360110Z   "requestId" : "C21A14E1-61A4-46EC-B08C-552C08B78FEB",
2024-10-24T19:26:07.3360940Z   "detail" : "The datastream ID 'DummyDatastreamID' referenced in your request does not exist. Update the request with a valid datastream ID and try again.",
2024-10-24T19:26:07.3361780Z   "type" : "https:\/\/ns.adobe.com\/aep\/errors\/EXEG-0003-400"
2024-10-24T19:26:07.3362120Z }
2024-10-24T19:26:07.3362350Z       timestamp: 2024-10-24 19:26:00 +0000
2024-10-24T19:26:07.3362840Z       responseId: nil
2024-10-24T19:26:07.3363200Z       parentId: Optional("30869B89-5397-4B19-97D7-1335F5218A55")
2024-10-24T19:26:07.3363700Z       mask: nil
2024-10-24T19:26:07.3363920Z     ]
2024-10-24T19:26:07.3365530Z /Users/runner/work/aepsdk-edge-ios/aepsdk-edge-ios/Tests/UpstreamIntegrationTests/ConfigOverrideTests.swift:328: error: -[UpstreamIntegrationTests.ConfigOverrideTests testSendEvent_withDummyDatastreamIDOverride_receivesExpectedNetworkResponseError] : XCTAssertEqual failed: ("1") is not equal to ("0")

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.

@timkimadobe timkimadobe requested review from addb and praveek October 25, 2024 02:00
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