Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix Flaky Test - Remove force unwrapping in URL response validation #2091

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

maxep
Copy link
Member

@maxep maxep commented Oct 24, 2024

What and why?

Some URL session tests depend on https://www.datadoghq.com which could fail to load (somehow). But our test are expecting data by force unwrapping the response.

How?

Loose the expectation by comparing the URL response with the response that was instrumented, regardless of its data.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes
  • Add Objective-C interface for public APIs (see our guidelines (internal)) and run make api-surface

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Oct 24, 2024

Datadog Report

Branch report: maxep/fix-flakiness
Commit report: 105faa2
Test service: dd-sdk-ios

✅ 0 Failed, 3345 Passed, 190 Skipped, 2m 20.27s Total duration (1m 14.36s time saved)
❄️ 1 New Flaky

New Flaky Tests (1)

  • testGivenURLSessionTask_withCustomDelegate_itInterceptsRequests - NetworkInstrumentationFeatureTests - Last Failure

    Expand for error
     
     Assertion Failure at NetworkInstrumentationFeatureTests.swift:398: Asynchronous wait failed: Exceeded timeout of 5 seconds, with unfulfilled expectations: "Notify intercepion did complete".
     Assertion Failure at NetworkInstrumentationFeatureTests.swift:399: XCTAssertEqual failed: ("1") is not equal to ("2") - Interceptor should intercept 2 tasks
    

@maxep maxep changed the title Fix Flaky Test- Remove force unwrapping in URL response validation Fix Flaky Test - Remove force unwrapping in URL response validation Oct 25, 2024
@maxep maxep marked this pull request as ready for review October 25, 2024 13:15
@maxep maxep requested review from a team as code owners October 25, 2024 13:15
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.

1 participant