V Testing gets stuck after starting server #18049
-
The computer I'm using is:
V version When I start up the server in tests it gets stuck with this banner:
I'm trying to copy how this test is done in V for my own application. So, an example application is: In the file module main
import vweb
struct App {
vweb.Context
}
fn main() {
mut app := &App{}
vweb.run(app, 8000)
}
['/hi'; get]
fn (mut app App) get_greeting() vweb.Result {
return app.text('Hello, George!')
} And the test code is module main
import os
import time
const (
vexe = @VEXE
serverexe = os.join_path(os.cache_dir(), 'server_tester.exe')
)
fn testsuite_begin() {
if os.exists(serverexe) {
os.rm(serverexe) or {}
}
}
fn test_created_executable() {
did_server_compile :=
os.system('${os.quoted_path(vexe)} -o ${os.quoted_path(serverexe)} .') // ##### Doesn't get stuck here #####
assert did_server_compile == 0
assert os.exists(serverexe)
}
fn test_starts_server() {
command := '${os.quoted_path(serverexe)} > /dev/null &'
res := os.system(command) // ######## Test gets stuck here ########
assert res == 0
time.sleep(100 * time.millisecond)
}
fn test_fail() {
assert 4 == 5
} I'm expecting that the When I run the code The real life code that I'm writing where the test gets stuck. https://stackoverflow.com/questions/76077504/v-testing-gets-stuck-after-starting-server |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I don't remember exactly what I did to fix the issue. But I do remember changing some of the app variables to |
Beta Was this translation helpful? Give feedback.
I don't remember exactly what I did to fix the issue. But I do remember changing some of the app variables to
[vweb_global]
and it was working after that. I'm sure I installed the latest version too. So, my guess is[vweb_global]
fixed it.