##// END OF EJS Templates
windows: use cpu-intensive task instead of real time in test...
Raphaël Gomès -
r48363:dc3f7aa1 default
parent child Browse files
Show More
@@ -73,7 +73,9 b' Install an extension that can sleep and '
73 > command = registrar.command(cmdtable)
73 > command = registrar.command(cmdtable)
74 > @command(b'sleep', [], b'hg sleep')
74 > @command(b'sleep', [], b'hg sleep')
75 > def sleep_for_at_least_one_stat_cycle(ui, *args, **kwargs):
75 > def sleep_for_at_least_one_stat_cycle(ui, *args, **kwargs):
76 > time.sleep(0.1)
76 > t = time.time() # don't use time.sleep because we need CPU time
77 > while time.time() - t < 0.5:
78 > pass
77 > EOF
79 > EOF
78
80
79 $ cat >> $HGRCPATH << EOF
81 $ cat >> $HGRCPATH << EOF
@@ -100,10 +102,19 b' Various statprof formatters work'
100 % cumulative self
102 % cumulative self
101 $ cat ../out | statprofran
103 $ cat ../out | statprofran
102
104
103 $ hg --profile --config profiling.statformat=hotpath sleep 2>../out || cat ../out
105 Windows real time tracking is broken, only use CPU
106
107 #if no-windows
108 $ hg --profile --config profiling.time-track=real --config profiling.statformat=hotpath sleep 2>../out || cat ../out
104 $ cat ../out | statprofran
109 $ cat ../out | statprofran
105 $ grep sleepext_with_a_long_filename.py ../out
110 $ grep sleepext_with_a_long_filename.py ../out | head -n 1
106 .* [0-9.]+% [0-9.]+s sleepext_with_a_long_filename.py:\s*sleep_for_at_least_one_stat_cycle, line 7: time\.sleep.* (re)
111 .* [0-9.]+% [0-9.]+s sleepext_with_a_long_filename.py:\s*sleep_for_at_least_one_stat_cycle, line \d+:\s+(while|pass).* (re)
112 #endif
113
114 $ hg --profile --config profiling.time-track=cpu --config profiling.statformat=hotpath sleep 2>../out || cat ../out
115 $ cat ../out | statprofran
116 $ grep sleepext_with_a_long_filename.py ../out | head -n 1
117 .* [0-9.]+% [0-9.]+s sleepext_with_a_long_filename.py:\s*sleep_for_at_least_one_stat_cycle, line \d+:\s+(while|pass).* (re)
107
118
108 $ hg --profile --config profiling.statformat=json sleep 2>../out || cat ../out
119 $ hg --profile --config profiling.statformat=json sleep 2>../out || cat ../out
109 $ cat ../out
120 $ cat ../out
General Comments 0
You need to be logged in to leave comments. Login now