Skip to content

Commit ad04009

Browse files
committed
try fix - handle parallel threads limit, replace first occurence of perf threshold sec
1 parent 3bc4af9 commit ad04009

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

.github/workflows/ios-perf.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ jobs:
5252
PerformanceTest/PerformanceTest.swift
5353

5454
- name: Inject Performance Threshold
55-
run: sed -i '.bak'
56-
'0,/{PERFORMANCE_THRESHOLD_SEC}/s/{PERFORMANCE_THRESHOLD_SEC}/${{ matrix.performanceThresholdSec }}/'
55+
run: sed -i '.bak'
56+
'1,/{PERFORMANCE_THRESHOLD_SEC}/s/{PERFORMANCE_THRESHOLD_SEC}/${{ matrix.performanceThresholdSec }}/'
5757
PerformanceTest/PerformanceTest.swift
5858

5959
- name: XCode Build

script/automation/browserstack.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,29 @@ def main(args: argparse.Namespace) -> None:
6565
'project': args.project_name,
6666
'devices': devices_dict[args.devices]
6767
}
68-
build_response = requests.post(
69-
BUILD_URI.format(args.type),
70-
headers=build_headers,
71-
json=build_data,
72-
auth=(args.username, args.access_key)
73-
)
68+
69+
while True:
70+
build_response = requests.post(
71+
BUILD_URI.format(args.type),
72+
headers=build_headers,
73+
json=build_data,
74+
auth=(args.username, args.access_key)
75+
)
76+
if (build_response is not None and 'message' in build_response.json() and '[BROWSERSTACK_ALL_PARALLELS_IN_USE]'
77+
in build_response.json()['message']):
78+
print('Parallel threads limit reached. Waiting...')
79+
time.sleep(60)
80+
else:
81+
break
82+
83+
if build_response is None:
84+
print('Build Failed')
85+
exit(1)
86+
7487
build_response_json = build_response.json()
7588

7689
if not build_response.ok:
77-
print('Build Failed', build_response_json)
78-
print('Build Response', build_response)
90+
print('Build Failed', build_response.json())
7991
exit(1)
8092

8193
if build_response_json['message'] != 'Success':

0 commit comments

Comments
 (0)