-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
sharness/t0060-daemon: don't reuse expect/actual names #1297
Conversation
test_cmp_repeat_10_sec expected actual_daemon | ||
echo "Initializing daemon..." >expected_daemon && | ||
echo "initializing ipfs node at $IPFS_PATH" >>expected_daemon && | ||
echo "generating 2048-bit RSA keypair...done" >>expected_daemon && |
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.
how was this passing? ...
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 disabled (test_expect_failure
)
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.
@cryptix any idea why it's failing? have we fixed it?
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.
Not sure what you mean, It passes now.
I wanted to see if it does so in the test runners before I change the expectation.
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.
the test is disabled:
test_expect_failure ...
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.
ah it's fixed now nvm.
I am not sure doing that this kind of changes is worth it.
|
Also it might give a false sense of security while making test scripts more difficult to review. For example if someone uses "expected_msg" at the top of a test script then you would want to make sure that "expected_msg" is used nowhere else in the same test script, which is difficult to maintain given that people often copy-paste tests. |
@chriscool in general i'd agree. The problem here was, that |
I also don't like to make sure the names all add up but other than a nifty helper that creates these file names for me, I don't see how to deal with this other than stopping test execution after the first error, which might not be what we want for all tests (edit: which also isn't satisfactory in the light of false positives)? |
@@ -14,6 +14,9 @@ test_expect_success "setup IPFS_PATH" ' | |||
' | |||
|
|||
# NOTE: this should remove bootstrap peers (needs a flag) | |||
# TODO(cryptix): | |||
# - we won't see daemon startup failure because we put the daemon in the background - fix: fork with exit code after api listen | |||
# - also default ports: might clash with local clients. Failure in that case isn't clear as well because pollEndpoint just uses the already running node |
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, this is what drove us in circles in #1277 - On dev box, there might be another daemon running (on test env there might be an unkilled daemon still running). The effect is that pollEndpoint passes by dialing another daemon.
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.
yeah, this issue is why iptb polls the 'ipfs id' endpoint and compares the returned ID against the expected one.
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.
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.
we could dump out the node id on the /version
endpoints
agreed
I'm not sure what a good solution. i think reusing the names can be annoying to debug. but also a partial solution isn't safe either. dont think it's a big deal either way |
sharness/t0060-daemon: don't reuse expect/actual names
Yeah, there is no easy way to be safe, we just have to accept that and be careful. It's easier to be careful when you can do fast pattern matching which is easier if the names are very often the same. For example if I see By the way, I created the following PR https://github.com/mlafeldt/sharness/pull/20 to add test_pause() from Git which might help debugging. |
If the names are reused, you might stare at the wrong output from another command, wondering what is going on.