docstr: Tests behavior on serialization.
  
  This test confirms that master's batch order can be overwritten,
  while slave's batch order cannot be overwritten, since slave must
  always distribute the completely same batch as master.
docstr_tok: ["Tests","behavior","on","serialization",".","This","test","confirms","that","master","'s","batch","order","can","be","overwritten",",","while","slave","'s","batch","order","can","not","be","overwritten",",","since","slave","must","always","distribute","the","completely","same","batch","as","master","."]
code: def test_overwrite_order(self):
      """Tests behavior on serialization.
  
      This test confirms that master's batch order can be overwritten,
      while slave's batch order cannot be overwritten, since slave must
      always distribute the completely same batch as master.
      """
  
      bs = 4
      rank_master = 0
      iterator = chainermn.iterators.create_multi_node_iterator(
          self.iterator_class(
              self.dataset, batch_size=bs, shuffle=True, repeat=False
          ),
          self.communicator,
          rank_master=rank_master,
      )
  
      target = dict()
      iterator.serialize(DummySerializer(target))
      order = target["order"]
      new_order = np.roll(order, 1)
      target["order"] = new_order
      iterator.serialize(DummyDeserializer(target))
  
      if self.communicator.rank == rank_master:
          self.assertEqual(
              iterator._state.order.tolist(), new_order.tolist()
          )
      else:
          self.assertEqual(iterator._order.tolist(), order.tolist())
  
imports: import chainer
  import chainer.testing
  import chainer.testing.attr
  import chainermn
  from chainermn.iterators.multi_node_iterator import _build_ctrl_msg
  from chainermn.iterators.multi_node_iterator import _parse_ctrl_msg
  import numpy
  import platform
  import pytest
  from six.moves import range
  import unittest
label_desc: Use image node_id 6 for calling the TestMultiNodeIterator obj's underlying member method code with example usage: obj.test_overwrite_order() without return types