Skip to content
Merged
2 changes: 2 additions & 0 deletions .azuredevops/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ extends:
template: /v2/OneBranch.Official.CrossPlat.yml@oneBranchPipelines
parameters:
featureFlags:
networkisolation:
policy: Permissive,CFSClean,CFSClean2,CFSClean3
WindowsHostVersion:
Version: 2022
Network: KS1
Expand Down
3 changes: 3 additions & 0 deletions .azuredevops/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ resources:
type: github
name: Azure/azure-sphere-tools
endpoint: 4x4
ref: refs/heads/main
trigger:
branches:
include:
Expand Down Expand Up @@ -49,6 +50,8 @@ extends:
template: /v2/OneBranch.NonOfficial.CrossPlat.yml@oneBranchPipelines
parameters:
featureFlags:
networkisolation:
policy: Permissive,CFSClean,CFSClean2,CFSClean3
WindowsHostVersion:
Version: 2022
Network: KS1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void ClearErrorReportData_Call_ReturnsEmptyJsonResponse()
{
string response = Device.ClearErrorReportData();

Assert.AreEqual(response, "{}");
Assert.AreEqual("{}", response);
}

/// <summary>
Expand All @@ -30,24 +30,32 @@ public void ClearErrorReportData_Call_ReturnsEmptyJsonResponse()
[TestMethod]
public void ClearErrorReportData_Call_ClearsErrorReportData()
{
string response = Device.ClearErrorReportData();

Assert.AreEqual(response, "{}");

//Wait for error data to clear or timeout
int maxMilliseconds = 1000;
int elapsedMilliseconds = 0;
int maxRetries = 3;
int maxMilliseconds = 5000;
int dataLength = -1;

int dataLength = GetDataLength(Device.GetErrorReportData());
while (dataLength != 0 && elapsedMilliseconds < maxMilliseconds)
for (int attempt = 1; attempt <= maxRetries; attempt++)
{
Thread.Sleep(100);
elapsedMilliseconds += 100;
string response = Device.ClearErrorReportData();
Assert.AreEqual("{}", response);

int elapsedMilliseconds = 0;
dataLength = GetDataLength(Device.GetErrorReportData());

while (dataLength != 0 && elapsedMilliseconds < maxMilliseconds)
{
Thread.Sleep(100);
elapsedMilliseconds += 100;
dataLength = GetDataLength(Device.GetErrorReportData());
}

if (dataLength == 0)
{
break;
}
}

Assert.AreEqual(dataLength, 0);
Assert.AreEqual(0, dataLength);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,24 @@ def test__clear_error_report_data__returns_empty():

def test__clear_error_report_data__clears_error_report_data():
"""Tests if clearing the error report data clears the error report data."""
response = device.clear_error_report_data()
max_retries = 3
max_milliseconds = 5000
data_length = -1

assert {} == response
for attempt in range(1, max_retries + 1):
response = device.clear_error_report_data()
assert {} == response

max_milliseconds = 1000
elapsed_milliseconds = 0
elapsed_milliseconds = 0
data_length = _get_data_length(device.get_error_report_data())

data_length = _get_data_length(device.get_error_report_data())
while data_length != 0 and elapsed_milliseconds < max_milliseconds:
time.sleep(0.1)
elapsed_milliseconds += 100
data_length = _get_data_length(device.get_error_report_data())

while data_length != 0 and elapsed_milliseconds < max_milliseconds:
time.sleep(0.1)
elapsed_milliseconds += 100
data_length = _get_data_length(device.get_error_report_data())
if data_length == 0:
break

assert data_length == 0

Expand Down
Loading