Property TimeoutMs
Namespace: Belay.Attributes
Assembly: Belay.Attributes.dll
TimeoutMs
Gets or sets the timeout for setup method execution in milliseconds. Setup methods may need longer timeouts for hardware initialization.
csharp
public int TimeoutMs { get; set; }
Property Value
Examples
[Setup(TimeoutMs = 30000)] // 30 second timeout for WiFi connection
private async Task ConnectToWiFiAsync()
{
await ExecuteAsync(@"
import network
import time
wifi = network.WLAN(network.STA_IF)
wifi.active(True)
wifi.connect('MyNetwork', 'password')
# Wait for connection
timeout = 25 # Leave some buffer
while not wifi.isconnected() and timeout > 0:
time.sleep(1)
timeout -= 1
if not wifi.isconnected():
raise Exception('WiFi connection failed')
");
}
Remarks
Hardware initialization often takes longer than normal operations, so setup methods may require extended timeouts. Consider the time needed for sensor stabilization, network connections, or file system operations.
Exceptions
Thrown when setting a timeout value that is less than or equal to zero.