File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
+ import sys
2
3
import tempfile
4
+ import time
3
5
from pathlib import Path
4
6
5
7
import pytest
@@ -23,10 +25,30 @@ def run_tests():
23
25
]
24
26
)
25
27
26
- print (f">>>>>>>>>> EXIT { returncode } <<<<<<<<<<" )
28
+ # On iOS and macOS, Briefcase needs to use a log streamer. However, this
29
+ # streamer can drop lines of test output due to system load. If the log
30
+ # result sentinel isn't seen in streamed output, the test will fail because
31
+ # the exit status of the test isn't known. As a safety measure on iOS and
32
+ # macOS, output the log sentinel multiple times to decrease the chance of
33
+ # this happening.
34
+ if sys .platform in {"darwin" , "ios" }:
35
+ for i in range (0 , 6 ):
36
+ time .sleep (0.5 )
37
+ print (f">>>>>>>>>> EXIT { returncode } <<<<<<<<<<" )
38
+ else :
39
+ print (f">>>>>>>>>> EXIT { returncode } <<<<<<<<<<" )
27
40
28
41
29
42
if __name__ == "__main__" :
43
+ # On iOS and macOS, Briefcase needs to use a log streamer. However, this
44
+ # streamer takes time to start up. As a safety measure, wait a couple of seconds
45
+ # at app start, and output some lines to minimize the impact of the streamer
46
+ # startup.
47
+ if sys .platform in {"darwin" , "ios" }:
48
+ print ("Waiting for log streamer..." )
49
+ time .sleep (2.0 )
50
+ print ("Log streamer should be ready." )
51
+
30
52
# Run the app main to stimulate app creation and logging of test conditions.
31
53
app_main ()
32
54
# Run the actual test suite.
You can’t perform that action at this time.
0 commit comments