-
Notifications
You must be signed in to change notification settings - Fork 315
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
Tests for metagraph, highlighting bug #2203
base: staging
Are you sure you want to change the base?
Tests for metagraph, highlighting bug #2203
Conversation
@ibraheem-opentensor could you review when you have time please |
Hey @mvds00 |
I will submit a PR. |
907f467
to
abbe79a
Compare
I rebased the PR on staging, the changes are still relevant. It tests save/load - I saw another PR was posted already fixing that. |
The following does not do what the author probably thought: assert 'a' and 'b' in s as it evaluates as: assert 'a' and ('b' in s) and hence: assert 'b' in s This is fixed by splitting the assertions in two or by changing the condition to ('a' in s and 'b' in s).
Using variable netuid instead of magic constant 1 (which happens to be the netuid of the added subnet) provides context to the usage of the value 1 and makes the test more future proof.
Saving and loading should transfer the complete state of the metagraph.
A minor tweak to the test that increases coverage of the test.
abbe79a
to
b63fae3
Compare
I just rebased it on staging, some tests fail but that is on purpose IIRC. |
f13f5f3
to
73d9fd4
Compare
Bug
The e2e test that tests metagraph has some flaws. Some assertions don't work as intended and a bug in metagraph is not caught. While I was at it I fixed some low hanging fruit, that is, some fragile constructions that may turn into bugs later on.
Description of the Change
assert 'a' and 'b' in s
as it doesn't test whether both'a'
and'b'
are ins
1
withnetuid
.save()
and.load()
on metagraphnote that the last test fails, but that is due to a bug in bittensor that has to be solved. This PR demonstrates there is a bug, and provides a test to see whether a (to be written) fix solves the bug.
Alternate Designs
Not relevant.
Possible Drawbacks
N/A
Verification Process
By doing
metagraph_pre_dave = subtensor.metagraph(netuid=netuid)
instead ofmetagraph_pre_dave.load()
it was verified that the assertions comparing distinct metagraph objects should work, if the metagraphs are in sync.Release Notes
N/A