1212import zlib
1313from builtins import input
1414from io import open
15+ from itertools import cycle
1516
1617from tornado .httpserver import HTTPServer
1718from tornado .ioloop import IOLoop
@@ -1391,7 +1392,7 @@ def _main_fuzz_loop(self, fuzz_case_iterator):
13911392
13921393 self .num_cases_actually_fuzzed = 0
13931394 self .start_time = time .time ()
1394- for mutation_context in fuzz_case_iterator :
1395+ for mutation_context , target in zip ( fuzz_case_iterator , cycle ( self . targets )) :
13951396 if self .total_mutant_index < self ._index_start :
13961397 continue
13971398
@@ -1402,8 +1403,7 @@ def _main_fuzz_loop(self, fuzz_case_iterator):
14021403 and self .num_cases_actually_fuzzed % self .restart_interval == 0
14031404 ):
14041405 self ._fuzz_data_logger .open_test_step ("restart interval of %d reached" % self .restart_interval )
1405- for target in self .targets :
1406- self ._restart_target (target )
1406+ self ._restart_target (target )
14071407
14081408 self ._fuzz_current_case (mutation_context , target )
14091409
@@ -1755,7 +1755,7 @@ def _fuzz_current_case(self, mutation_context, target):
17551755 current_message = node ,
17561756 )
17571757 mutation_context .protocol_session = protocol_session
1758- callback_data = self ._callback_current_node (node = node , edge = e , test_case_context = protocol_session )
1758+ callback_data = self ._callback_current_node (target = target , node = node , edge = e , test_case_context = protocol_session )
17591759 self ._fuzz_data_logger .open_test_step ("Transmit Prep Node '{0}'" .format (node .name ))
17601760 self .transmit_normal (target , node , e , callback_data = callback_data , mutation_context = mutation_context )
17611761
@@ -1767,7 +1767,7 @@ def _fuzz_current_case(self, mutation_context, target):
17671767 )
17681768 mutation_context .protocol_session = protocol_session
17691769 callback_data = self ._callback_current_node (
1770- node = self .fuzz_node , edge = mutation_context .message_path [- 1 ], test_case_context = protocol_session
1770+ target = target , node = self .fuzz_node , edge = mutation_context .message_path [- 1 ], test_case_context = protocol_session
17711771 )
17721772 self ._fuzz_data_logger .open_test_step ("Fuzzing Node '{0}'" .format (self .fuzz_node .name ))
17731773 self .transmit_fuzz (
0 commit comments