Skip to contentSkip to conversation

dts: fix deterministic doc

PATCH Superseded Clemens Famulla-Conrad 4 participants 6 messages Jun 6, 2025 – Jun 19, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dts: fix deterministic doc

Previously, capture_name defaulted to a "dynamic" value. This caused non-deterministic documentation and could lead to overwriting capture files if the method was called multiple times within a single Python process.

Bugzilla ID: 1718

---
 .mailmap                                                     | 1 +
 .../traffic_generator/capturing_traffic_generator.py         | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
.mailmap +1 -0
index 76f65e5114..cd5362f130 100644
@@ -272,6 +272,7 @@ Cian Ferriter <[email protected]>
 Ciara Loftus <[email protected]>
 Ciara Power <[email protected]>
 Claire Murphy <[email protected]>
+Clemens Famulla-Conrad <[email protected]>
 Cody Doucette <[email protected]>
 Congwen Zhang <[email protected]>
 Conor Fogarty <[email protected]>
dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py +4 -1
index 66a77da9c4..c1e4a898d4 100644
@@ -70,7 +70,7 @@ def send_packets_and_capture(
         receive_port: Port,
         filter_config: PacketFilteringConfig,
         duration: float,
-        capture_name: str = _get_default_capture_name(),
+        capture_name: str = None,
     ) -> list[Packet]:
         """Send `packets` and capture received traffic.
 
@@ -104,6 +104,9 @@ def send_packets_and_capture(
             duration,
         )
 
+        if capture_name is None:
+            capture_name = _get_default_capture_name()
+
         self._logger.debug(f"Received packets: {get_packet_summaries(received_packets)}")
         self._write_capture_from_packets(capture_name, received_packets)
         return received_packets
Signature · 1 line
2.43.0
#1 lore raw

Thanks. This needs to pass the linter, see my suggestions below.

Quoted 1 line · Clemens Famulla-Conrad

+ capture_name: str = None,

+ capture_name: str = "",

dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py def send_packets_and_capture( · line 109

Quoted 3 lines
dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py +3 -0
+        if capture_name is None:
+            capture_name = _get_default_capture_name()
+

+ if not capture_name:
+ capture_name = _get_default_capture_name()

#2 lore raw

PATCH v2 1/1 dts: fix deterministic doc

Previously, capture_name defaulted to a "dynamic" value. This caused non-deterministic documentation and could lead to overwriting capture files if the method was called multiple times within a single Python process.

Bugzilla ID: 1718

---
 .mailmap                                                     | 1 +
 .../traffic_generator/capturing_traffic_generator.py         | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
.mailmap +1 -0
index 76f65e5114..cd5362f130 100644
@@ -272,6 +272,7 @@ Cian Ferriter <[email protected]>
 Ciara Loftus <[email protected]>
 Ciara Power <[email protected]>
 Claire Murphy <[email protected]>
+Clemens Famulla-Conrad <[email protected]>
 Cody Doucette <[email protected]>
 Congwen Zhang <[email protected]>
 Conor Fogarty <[email protected]>
dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py +4 -1
index 66a77da9c4..f485043f73 100644
@@ -70,7 +70,7 @@ def send_packets_and_capture(
         receive_port: Port,
         filter_config: PacketFilteringConfig,
         duration: float,
-        capture_name: str = _get_default_capture_name(),
+        capture_name: str = "",
     ) -> list[Packet]:
         """Send `packets` and capture received traffic.
 
@@ -104,6 +104,9 @@ def send_packets_and_capture(
             duration,
         )
 
+        if not capture_name:
+            capture_name = _get_default_capture_name()
+
         self._logger.debug(f"Received packets: {get_packet_summaries(received_packets)}")
         self._write_capture_from_packets(capture_name, received_packets)
         return received_packets
Signature · 1 line
2.43.0
#3 lore raw
Quoted 1 line

Thanks. This needs to pass the linter, see my suggestions below.

Thanks for your suggestions!

The CI is still failing[1] in "Windows Server 2022" => dpdk_msvc_compile
I don't see a relation to my change and also other patches show the same issue[2]. Not sure if I need to do something, do you have an advice?

[1] http://mails.dpdk.org/archives/test-report/2025-June/885350.html
[2] http://mails.dpdk.org/archives/test-report/2025-June/885280.html

#4 lore raw

Yes the windows failure was unrelated to your patch - sorry about the noise.

Looks like Paul has applied this commit to next-dts.

Quoted 13 lines · Clemens Famulla-Conrad
Quoted 1 line

Thanks. This needs to pass the linter, see my suggestions below.

Thanks for your suggestions!

The CI is still failing[1] in "Windows Server 2022" => dpdk_msvc_compile
I don't see a relation to my change and also other patches show the same issue[2]. Not sure if I need to do something, do you have an advice?

[1] http://mails.dpdk.org/archives/test-report/2025-June/885350.html
[2] http://mails.dpdk.org/archives/test-report/2025-June/885280.html