-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add a test for reading a file #64
Conversation
170e483
to
19d9973
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR 🎉
I left a few comments. Just a little more!
log.fatal.printf("fd_read failed: {d}\n", .{@intFromEnum(res)}); | ||
return false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add verification of the content?
You can use std.mem.eql to compare two strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made changes to the original code, but I've run into a new problem.
Run the command: zig build -Dtest=true -Doptimize=ReleaseFast -Dlog-level=debug run
for testing time. Some times it succeeds
and some times it fails
, I don't know why.
[LOG DEBUG]: WASI path_open: fd:3, dirflags:0, path_offset:4, path_length:8, oflags:0, rights_bas:0, rights_inferiting:0, fdflags:0, opened_fd_addr:0
[LOG DEBUG]: file path: test.txt
[LOG DEBUG]: WASI fd_read: fd=7 buf_iovec_addr=0xc8 vec_len=1 size_addr=0x64
[LOG DEBUG]: WASI fd_close: 7
[LOG FATAL]: Integration test passed
+ QEMU_RETURN_CODE=1
+ RETURN_CODE=0
+ exit 0
+ grep -q 'Integration test passed' build/test/output.txt
+ echo -e '\nIntegration Test PASSED!!'
[LOG DEBUG]: interrupt
[LOG INFO]: client socket test: sock_connect succeeded
[LOG DEBUG]: WASI fd_write: 4 12 2 52
[LOG DEBUG]: interrupt
[LOG DEBUG]: interrupt
[LOG DEBUG]: interrupt
[LOG INFO]: client socket test: fd_write succeeded
[LOG DEBUG]: WASI sock_getlocaladdr: 4 4 40 44
[LOG INFO]: sock_getlocaladdr failed: 112.193.56.4
+ exit 1
run ./scripts/integration-test.sh: error: the following command exited with error code 1:
./scripts/integration-test.sh
Build Summary: 8/10 steps succeeded; 1 failed (disable with --summary none)
run transitive failure
└─ run ./scripts/integration-test.sh failure
error: the following build command failed with exit code 1:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh it's really strange. Does this problem occur only when adding the verification of the file content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh it's really strange. Does this problem occur only when adding the verification of the file content?
It seems that the occurrence doesn't happen with the testReadfile()
function, because the error still occurs after commenting.
Right now I'm not clear on what this is and may need to keep learning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the problem is not triggered by this PR, right?
We might need to open a new issue. But I've not come across this error, so we need to know the condition.
Does it reproduce on Codespaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm using devcontainer. i get the occasional error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've confirmed it reproduces on Codespaces on main branch.
So this problem is not related to this PR. I'll create a new issue and merge this PR.
0dcd273
to
12f2eee
Compare
submodules/lwip
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/mewz-project/mewz/actions/runs/8771224567/job/24070669535?pr=64
b413b0
doesn't seem to exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/mewz-project/mewz/actions/runs/8771224567/job/24070669535?pr=64
b413b0
doesn't seem to exist.
How am I supposed to do that? Is it ok to use this command: git submodule update --init
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will fix this.
Or, you can manually checkout to 0dcd273
.
cd submodules/lwip
git checkout 0dcd273
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, you can manually checkout to
0dcd273
.
root@ser300462488588:/data/mewz/submodules/lwip# git checkout 0dcd273
error: pathspec '0dcd273' did not match any file(s) known to git
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry this will work
git checkout 1cc153
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's switched over. Try again.
Signed-off-by: dierbei <[email protected]>
12f2eee
to
01a085b
Compare
@dierbei Thanks for your contribution 🎉 |
Please review this for me, thank you!,#59