Skip to content

Commit

Permalink
Merge branch 'master' into comp-md-bindings.gcp.bucket-2573
Browse files Browse the repository at this point in the history
  • Loading branch information
robertojrojas authored Aug 4, 2023
2 parents 2df3670 + 80fdafc commit 2cf2201
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions internal/wasm/wasm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,14 @@ func TestNewModuleConfig(t *testing.T) {
maxDuration: 50 * time.Millisecond * 5,
},
{
name: "strictSandbox = true",
metadata: &InitMetadata{StrictSandbox: true, Guest: binStrict},
minDuration: 10 * time.Microsecond,
name: "strictSandbox = true",
metadata: &InitMetadata{StrictSandbox: true, Guest: binStrict},
// In strict mode, nanosleep is implemented by an incrementing
// number. The resolution of the real clock timing the wasm
// invocation is lower resolution in Windows, so we can't verify a
// lower bound. In any case, the important part is that we aren't
// actually sleeping 50ms, which is what wasm thinks is happening.
minDuration: 0,
maxDuration: 1 * time.Millisecond,
},
}
Expand Down Expand Up @@ -211,7 +216,8 @@ func TestNewModuleConfig(t *testing.T) {
} else {
require.NotEqual(t, deterministicOut, out.String())
}
require.True(t, duration > tc.minDuration && duration < tc.maxDuration, duration)
require.GreaterOrEqual(t, duration, tc.minDuration)
require.LessOrEqual(t, duration, tc.maxDuration)
})
}
}

0 comments on commit 2cf2201

Please sign in to comment.