Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unstable test: TestHotReloadUIConfigTempFile #3702

Closed
yurishkuro opened this issue May 25, 2022 · 6 comments · Fixed by #3726
Closed

Unstable test: TestHotReloadUIConfigTempFile #3702

yurishkuro opened this issue May 25, 2022 · 6 comments · Fixed by #3726
Labels
bug good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement

Comments

@yurishkuro
Copy link
Member

I've seen this one failing sporadically:

=== RUN   TestHotReloadUIConfigTempFile
    static_handler_test.go:279: 
        	Error Trace:	static_handler_test.go:279
        	Error:      	"" does not contain "About a new Jaeger"
        	Test:       	TestHotReloadUIConfigTempFile
        	Messages:   	[{Entry:{Level:info Time:2022-05-25 20:44:07.707232055 +0000 UTC m=+2.677106569 LoggerName: Message:watching Caller:undefined Stack:} Context:[{Key:file Type:15 Integer:0 String:/tmp/ui-config-hotreload-225331457/486536771.json Interface:<nil>}]} {Entry:{Level:info Time:2022-05-25 20:44:07.707258755 +0000 UTC m=+2.677133369 LoggerName: Message:watching Caller:undefined Stack:} Context:[{Key:dir Type:15 Integer:0 String:/tmp/ui-config-hotreload-225331457 Interface:<nil>}]} {Entry:{Level:info Time:2022-05-25 20:44:07.708553363 +0000 UTC m=+2.678427877 LoggerName: Message:reloading UI config Caller:undefined Stack:} Context:[{Key:filename Type:15 Integer:0 String:/tmp/ui-config-hotreload-225331457/486536771.json Interface:<nil>}]} {Entry:{Level:error Time:2022-05-25 20:44:07.708720364 +0000 UTC m=+2.678594978 LoggerName: Message:error while reloading the UI config Caller:undefined Stack:} Context:[{Key:error Type:26 Integer:0 String: Interface:cannot parse UI config file /tmp/ui-config-hotreload-225331457/486536771.json: unexpected end of JSON input}]} {Entry:{Level:info Time:2022-05-25 20:44:07.708730865 +0000 UTC m=+2.678605379 LoggerName: Message:reloaded UI config Caller:undefined Stack:} Context:[{Key:filename Type:15 Integer:0 String:/tmp/ui-config-hotreload-225331457/486536771.json Interface:<nil>}]} {Entry:{Level:info Time:2022-05-25 20:44:07.708748465 +0000 UTC m=+2.678623079 LoggerName: Message:reloading UI config Caller:undefined Stack:} Context:[{Key:filename Type:15 Integer:0 String:/tmp/ui-config-hotreload-225331457/486536771.json Interface:<nil>}]} {Entry:{Level:error Time:2022-05-25 20:44:07.708856265 +0000 UTC m=+2.678730879 LoggerName: Message:error while reloading the UI config Caller:undefined Stack:} Context:[{Key:error Type:26 Integer:0 String: Interface:cannot parse UI config file /tmp/ui-config-hotreload-225331457/486536771.json: unexpected end of JSON input}]} {Entry:{Level:info Time:2022-05-25 20:44:07.708863765 +0000 UTC m=+2.678738379 LoggerName: Message:reloaded UI config Caller:undefined Stack:} Context:[{Key:filename Type:15 Integer:0 String:/tmp/ui-config-hotreload-225331457/486536771.json Interface:<nil>}]}]
--- FAIL: TestHotReloadUIConfigTempFile (0.02s)

Likely some kind of race condition dependent on the timing of hot reload.

@yurishkuro yurishkuro added bug help wanted Features that maintainers are willing to accept but do not have cycles to implement good first issue Good for beginners labels May 25, 2022
@Frapschen
Copy link

Frapschen commented May 30, 2022

hi,I can help it.

@yurishkuro
Copy link
Member Author

please do

@Frapschen
Copy link

Frapschen commented May 30, 2022

as the code refer(static_handler.go line:238):

		if err := json.Unmarshal(bytesConfig, &c); err != nil {
			return nil, fmt.Errorf("cannot parse UI config file %v: %w", uiConfig, err)
		}

if there occur a error, the err must be not nil, while the log info show that the err is <nil>. how it can happen?

@yurishkuro
Copy link
Member Author

The error in the logs is "cannot parse UI config file /tmp/ui-config-hotreload-225331457/486536771.json: unexpected end of JSON input"

@yurishkuro
Copy link
Member Author

Are we overwriting the file content or replacing the file with mv command?

@Frapschen
Copy link

Are we overwriting the file content or replacing the file with mv command?
I just overwrite the file content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement
Projects
None yet
2 participants