mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0032870: Tests - bugs/caf/bug31918_1 is unstable
Improved the test stability: created 10 iterations of measurements and take the minimum to minimize the affect of other processes and threads; increased the compare range of the quarter and the whole of the document load.
This commit is contained in:
parent
43764346a1
commit
3d41db2138
@ -27,27 +27,37 @@ CommitCommand D0
|
|||||||
SaveAs D0 ${docname}
|
SaveAs D0 ${docname}
|
||||||
Close D0
|
Close D0
|
||||||
|
|
||||||
set whole_time [lindex [time {
|
# Computes the elapsed time of open and close document with a given arguments (as text).
|
||||||
Open ${docname} D1
|
# It launches 10 iteration, 10 actions in each. Returns time of average time of the minimum-time iteration.
|
||||||
Close D1
|
proc action_time args {
|
||||||
} 20] 0]
|
global docname
|
||||||
|
set min_time 1000000
|
||||||
|
for {set iter 0} {$iter < 10} {incr iter} {
|
||||||
|
set iter_time [lindex [time {
|
||||||
|
Open ${docname} D {*}$args
|
||||||
|
Close D
|
||||||
|
} 10] 0]
|
||||||
|
puts "Iteration time $iter_time mcs"
|
||||||
|
if {$iter_time < $min_time} {
|
||||||
|
set min_time $iter_time
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $min_time
|
||||||
|
}
|
||||||
|
|
||||||
|
set whole_time [action_time]
|
||||||
puts "Whole document open time $whole_time mcs"
|
puts "Whole document open time $whole_time mcs"
|
||||||
|
|
||||||
set quater_time [lindex [time {
|
set quater_time [action_time -read0:2]
|
||||||
Open ${docname} D2 -read0:2
|
|
||||||
Close D2
|
|
||||||
} 20] 0]
|
|
||||||
puts "Quater of document open time $quater_time mcs"
|
puts "Quater of document open time $quater_time mcs"
|
||||||
|
|
||||||
# Check that open of quater of the document is at least twice faster than open of whole.
|
# Check that open of quater of the document is significantly faster than open of whole.
|
||||||
if { [expr $quater_time * 2] > $whole_time } {
|
if { [expr $quater_time * 1.75] > $whole_time } {
|
||||||
puts "Error : loading of quater of the document content too slow relatively to the whole document load"
|
puts "Error : loading of quater of the document content too slow relatively to the whole document load"
|
||||||
}
|
}
|
||||||
|
|
||||||
set four_quaters_time [lindex [time {
|
set four_quaters_time [action_time -read0:1 -read0:2 -read0:3 -read0:4]
|
||||||
Open ${docname} D3 -read0:1 -read0:2 -read0:3 -read0:4
|
|
||||||
Close D3
|
|
||||||
} 20] 0]
|
|
||||||
puts "Four quaters of document open time $four_quaters_time mcs"
|
puts "Four quaters of document open time $four_quaters_time mcs"
|
||||||
|
|
||||||
# Check that open of four quaters of the document is not too much slower than opening of the whole document.
|
# Check that open of four quaters of the document is not too much slower than opening of the whole document.
|
||||||
@ -69,6 +79,7 @@ if {![catch {Attributes D4 0:1:1:13}] || ![catch {Attributes D4 0:1:3:14}] || ![
|
|||||||
puts "Error : loading of document skipping arrays and sub-trees contains invalid attributes list"
|
puts "Error : loading of document skipping arrays and sub-trees contains invalid attributes list"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check for appending arrays to the document from the file
|
||||||
set append_arrays_time [lindex [time {
|
set append_arrays_time [lindex [time {
|
||||||
Open ${docname} D4 -append -readTDataStd_IntegerArray -read0:2 -read0:3
|
Open ${docname} D4 -append -readTDataStd_IntegerArray -read0:2 -read0:3
|
||||||
}] 0]
|
}] 0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user