tests: reduce probability of locks during macos runs of live_test.v
parent
d77669da80
commit
06a02c41c3
|
@ -52,7 +52,6 @@ fn append_to_file(fname, s string) {
|
||||||
f.writeln('\$s')
|
f.writeln('\$s')
|
||||||
//info := live.info()
|
//info := live.info()
|
||||||
//f.writeln('>>> reloads: \${info.reloads} | ok reloads: \${info.reloads_ok}')
|
//f.writeln('>>> reloads: \${info.reloads} | ok reloads: \${info.reloads_ok}')
|
||||||
f.flush()
|
|
||||||
f.close()
|
f.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,13 +63,11 @@ fn myprintln(s string) {
|
||||||
|
|
||||||
[live]
|
[live]
|
||||||
fn pmessage() string {
|
fn pmessage() string {
|
||||||
s := 'ORIGINAL'
|
return 'ORIGINAL'
|
||||||
myprintln(s)
|
|
||||||
return s
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
delay = 5
|
delay = 20
|
||||||
)
|
)
|
||||||
fn edefault(name string, default string) string {
|
fn edefault(name string, default string) string {
|
||||||
res := os.getenv(name)
|
res := os.getenv(name)
|
||||||
|
@ -87,14 +84,15 @@ fn main() {
|
||||||
pmessage()
|
pmessage()
|
||||||
pmessage()
|
pmessage()
|
||||||
max_cycles := edefault('LIVE_CYCLES', '1').int()
|
max_cycles := edefault('LIVE_CYCLES', '1').int()
|
||||||
// NB: 1000 * 5 = maximum of ~5s runtime
|
// NB: 1000 * 20 = maximum of ~20s runtime
|
||||||
for i:=0; i<max_cycles; i++ {
|
for i:=0; i<max_cycles; i++ {
|
||||||
s := pmessage()
|
s := pmessage()
|
||||||
|
myprintln(s)
|
||||||
append_to_file(os.resource_abs_path(s + '.txt'), s)
|
append_to_file(os.resource_abs_path(s + '.txt'), s)
|
||||||
time.sleep_ms(delay)
|
|
||||||
if s == 'STOP' {
|
if s == 'STOP' {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
time.sleep_ms(delay)
|
||||||
}
|
}
|
||||||
pmessage()
|
pmessage()
|
||||||
pmessage()
|
pmessage()
|
||||||
|
@ -192,8 +190,8 @@ fn setup_cycles_environment() {
|
||||||
mut max_live_cycles := 1000
|
mut max_live_cycles := 1000
|
||||||
mut max_wait_cycles := 400
|
mut max_wait_cycles := 400
|
||||||
if os.user_os() == 'macos' {
|
if os.user_os() == 'macos' {
|
||||||
max_live_cycles *= 5
|
// max_live_cycles *= 5
|
||||||
max_wait_cycles *= 5
|
// max_wait_cycles *= 5
|
||||||
}
|
}
|
||||||
os.setenv('LIVE_CYCLES', '$max_live_cycles', true)
|
os.setenv('LIVE_CYCLES', '$max_live_cycles', true)
|
||||||
os.setenv('WAIT_CYCLES', '$max_wait_cycles', true)
|
os.setenv('WAIT_CYCLES', '$max_wait_cycles', true)
|
||||||
|
|
Loading…
Reference in New Issue