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 PIR E2E tests failing the first time #3743

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
26bd4ad
Temporarily hardcode exeuction config values to be fast to see if it …
THISISDINOSAUR Jan 16, 2025
d9c7246
Pointless change to trigger CI
THISISDINOSAUR Jan 16, 2025
789806b
Try deleting and readding from the fake broker
THISISDINOSAUR Jan 16, 2025
e504452
Try replicating all steps
THISISDINOSAUR Jan 16, 2025
9dcaa85
Fix expectation
THISISDINOSAUR Jan 16, 2025
0217984
Increase opt out confirm timeout
THISISDINOSAUR Jan 16, 2025
3c4d8e0
Try just deleting the fake broker profile
THISISDINOSAUR Jan 16, 2025
f11d7af
Add wait before doing anything to see if it helps
THISISDINOSAUR Jan 17, 2025
c52b5b9
Go back to doing everything twice
THISISDINOSAUR Jan 17, 2025
d2b0a6f
Remove fake broker repeat
THISISDINOSAUR Jan 17, 2025
4cb407d
Remove the first lot of step 4 and 5 to see if it still works
THISISDINOSAUR Jan 17, 2025
4cc541d
Remove step 2 and 3 to see if it still works
THISISDINOSAUR Jan 17, 2025
a051fa8
Try disabling reenabling login item before step 9
THISISDINOSAUR Jan 17, 2025
da8e42e
Random change to ake tests run again
THISISDINOSAUR Jan 17, 2025
a434185
Set all fake broker json values to zero to see if it works
THISISDINOSAUR Jan 17, 2025
0b32b46
Keep retry error at 48
THISISDINOSAUR Jan 17, 2025
e1a8a06
Increase optOutScan value to see if it still works
THISISDINOSAUR Jan 17, 2025
12528d4
Try removing the filter within Operation
THISISDINOSAUR Jan 17, 2025
4f46df9
Random change to try and pretty please make the tests run
THISISDINOSAUR Jan 17, 2025
dc27737
Merge branch 'main' into elle/fix-pir-e2e-tests-failing-first-time
THISISDINOSAUR Jan 17, 2025
242c252
Revert priority date change
THISISDINOSAUR Jan 17, 2025
8b95410
Merge branch 'elle/fix-pir-e2e-tests-failing-first-time' of github.co…
THISISDINOSAUR Jan 17, 2025
68e285a
Increase config intervals
THISISDINOSAUR Jan 17, 2025
6e0c6f6
Revert "Increase config intervals"
THISISDINOSAUR Jan 17, 2025
ba5da82
Remove hour from date to further narrow search space
THISISDINOSAUR Jan 17, 2025
1b5afdf
Fix doing priority date the wrong way round
THISISDINOSAUR Jan 17, 2025
ef52b57
Try 12 hours
THISISDINOSAUR Jan 17, 2025
4ecb7dd
Increase to 40
THISISDINOSAUR Jan 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions DBPE2ETests/DBPEndToEndTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ final class DBPEndToEndTests: XCTestCase {
// Fake broker set up
await deleteAllProfilesOnFakeBroker()

let mockUserProfile = mockFakeBrokerUserProfile()
let returnedUserProfile = await createProfileOnFakeBroker(mockUserProfile)
var mockUserProfile = mockFakeBrokerUserProfile()
var returnedUserProfile = await createProfileOnFakeBroker(mockUserProfile)
XCTAssertEqual(mockUserProfile.firstName, returnedUserProfile.firstName)

// When
Expand Down Expand Up @@ -270,6 +270,12 @@ final class DBPEndToEndTests: XCTestCase {
*/
print("Stages 6-8 skipped: Fake broker doesn't support sending emails")

/*
loginItemsManager = LoginItemsManager()
loginItemsManager.disableLoginItems([LoginItem.dbpBackgroundAgent])
loginItemsManager.enableLoginItems([LoginItem.dbpBackgroundAgent])
*/

/*
9/ We confirm the opt out through a scan
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ class DataBrokerOperation: Operation, @unchecked Sendable {
let filteredAndSortedOperationsData: [BrokerJobData]

if let priorityDate = priorityDate {
let date = Calendar.current.date(byAdding: .hour, value: 40, to: priorityDate)!
filteredAndSortedOperationsData = operationsData
.eligibleForRun(byDate: priorityDate)
.sortedByPreferredRunDate()
.filter { $0.preferredRunDate != nil && $0.preferredRunDate! <= date }
.sorted { $0.preferredRunDate! < $1.preferredRunDate! }
} else {
filteredAndSortedOperationsData = operationsData
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"schedulingConfig": {
"retryError": 48,
"confirmOptOutScan": 0,
"maintenanceScan": 120,
"maintenanceScan": 24,
"maxAttempts": -1
},
"addedDatetime": 1725632531153,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public struct DataBrokerExecutionConfig {
var activitySchedulerTriggerInterval: TimeInterval {
switch mode {
case .normal:
return 20 * 60 // 20 minutes
return 1 * 60 // 20 minutes
case .fastForIntegrationTests:
return 1 * 60 // 1 minute
}
Expand All @@ -53,7 +53,7 @@ public struct DataBrokerExecutionConfig {
var activitySchedulerIntervalTolerance: TimeInterval {
switch mode {
case .normal:
return 10 * 60 // 10 minutes
return 30 // 10 minutes
case .fastForIntegrationTests:
return 30 // 0.5 minutes
}
Expand Down
Loading