Integration dendrite test fixes
flaky test fixes
@@ -25,12 +25,14 @@ from . import constant
wallet = bittensor.wallet.mock()
dendrite = bittensor.dendrite( wallet = wallet )
+port = get_random_unused_port()
+
neuron_obj = bittensor.endpoint(
version = bittensor.__version_as_int__,
uid = 0,
ip = '0.0.0.0',
ip_type = 4,
- port = 12345,
+ port = port,
hotkey = dendrite.wallet.hotkey.ss58_address,
coldkey = dendrite.wallet.coldkey.ss58_address,
modality = 0
@@ -40,7 +42,8 @@ synapses = [bittensor.synapse.TextLastHiddenState(),
bittensor.synapse.TextCausalLM(),
bittensor.synapse.TextCausalLMNext(),
bittensor.synapse.TextSeq2Seq(num_to_generate=constant.synapse.num_to_generate)]
-dataset = bittensor.dataset(num_batches=20, dataset_name = ['Books3'])
+
+dataset = bittensor.dataset(num_batches=10, _mock=True)
def check_resp_shape(resp, num_resp, block_size, seq_len):
assert len(resp) == num_resp
@@ -188,17 +191,17 @@ def test_dendrite_forward_tensor():
def test_dendrite_backoff():
_dendrite = bittensor.dendrite( wallet = wallet )
+ port = get_random_unused_port()
_endpoint_obj = bittensor.endpoint(
version = bittensor.__version_as_int__,
uid = 0,
ip = '0.0.0.0',
ip_type = 4,
- port = 12345,
+ port = port,
hotkey = _dendrite.wallet.hotkey.ss58_address,
coldkey = _dendrite.wallet.coldkey.ss58_address,
modality = 0
)
- print (_endpoint_obj)
# Normal call.
x = torch.rand(3, 3, dtype=torch.float32)
