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

TestRecover fail #2172

Open
fungaren opened this issue Oct 18, 2024 · 4 comments
Open

TestRecover fail #2172

fungaren opened this issue Oct 18, 2024 · 4 comments
Labels
kind/failing-test failing-test

Comments

@fungaren
Copy link
Contributor

Which jobs are failing:

Which test(s) are failing:

pkg/yurthub/cachemanager/error_keys_test.go

--- PASS: TestXxx (0.00s)
    --- PASS: TestXxx/test1 (0.00s)
=== RUN   TestRecover
    error_keys_test.go:109: failed to recover
--- FAIL: TestRecover (0.00s)
=== RUN   TestCompress

Since when has it been failing:

Testgrid link:

Reason for failure:

These two tests share the same variable AOFPrefix.

The result of Unmarshal() is not checked.

https://github.com/openyurtio/openyurt/blob/v1.5.0/pkg/yurthub/cachemanager/error_keys.go#L235

Actually the data in the /tmp/errorkeys/aof is:

{"Operator":"put","Key":"kubelet","Val":"fail to xxx"}perator":"put","Key":"key-31","Val":"value-31"}
{"Operator":"put","Key":"key-32","Val":"value-32"}
{"Operator":"put","Key":"key-34","Val":"value-34"}
...

Because of the wrong open mode os.O_CREATE|os.O_RDWR, it should has O_TRUNC to make the file clean.

Anything else we need to know:

labels

/kind failing-test

@fungaren fungaren added the kind/failing-test failing-test label Oct 18, 2024
@fungaren fungaren changed the title Unit test fail: TestRecover fail Oct 18, 2024
@luc99hen
Copy link
Member

@vie-serendipity Please take a look

@vie-serendipity
Copy link
Member

@fungaren This is indeed a bug. Are you willing to fix it?

@fungaren
Copy link
Contributor Author

@vie-serendipity Sorry I am afraid I can't, because I have not read the related code carefully.

@vie-serendipity
Copy link
Member

@fungaren ok, thanks for spotting this bug. I'll fix that later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/failing-test failing-test
Projects
None yet
Development

No branches or pull requests

3 participants