Skip to content

Commit

Permalink
Use preloadable temporary module in ValidateMetrics (#6648)
Browse files Browse the repository at this point in the history
The `ValidateMetrics` end-to-end test deploys a module to the test device then removes it in order to bump a particular metric. It doesn't matter which module is used; we just need to add something then remove it. Currently, we've hardcoded `mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0`. Because that isn't one of the images listed in context.json, our test pipeline doesn't preload it on slow test devices, which means it has to be downloaded during the test, which eats into the test's timeout duration.

The `ValidateMetrics` test is consistently timing out on Raspberry Pi. Changing the test to use the tempSensor image from context.json _should_ speed up the test and prevent the timeouts.

I ran the end-to-end pipeline against these changes and `ValidateMetrics` passed on Raspberry Pi.
  • Loading branch information
damonbarry authored Sep 2, 2022
1 parent 6268f8b commit 78cfd01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/Microsoft.Azure.Devices.Edge.Test/Metrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ static class EdgeConfigBuilderEx
public static void AddTemporaryModule(this EdgeConfigBuilder builder)
{
const string Name = "stopMe";
const string Image = "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0";
builder.AddModule(Name, Image).WithEnvironment(new[] { ("MessageCount", "0") });
string image = Context.Current.TempSensorImage.Expect(() => new InvalidOperationException("Missing Temp Sensor image"));
builder.AddModule(Name, image).WithEnvironment(new[] { ("MessageCount", "0") });
}

public static void AddMetricsValidatorConfig(this EdgeConfigBuilder builder, string image)
Expand Down

0 comments on commit 78cfd01

Please sign in to comment.