Skip to content

Commit

Permalink
fix seed num judge error (#18972)
Browse files Browse the repository at this point in the history
  • Loading branch information
tadelesh authored Aug 30, 2022
1 parent 4480e9f commit bd89adb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
9 changes: 2 additions & 7 deletions sdk/resourcemanager/internal/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# Release History

## 1.1.1 (Unreleased)

### Features Added

### Breaking Changes
## 1.1.1 (2022-08-30)

### Bugs Fixed

### Other Changes
* Fix seed not stable with `GenerateAlphaNumericID` when playback

## 1.1.0 (2022-08-24)

Expand Down
2 changes: 1 addition & 1 deletion sdk/resourcemanager/internal/testutil/recording.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func GenerateAlphaNumericID(t *testing.T, prefix string, length int) string {
variables := recording.GetVariables(t)
if seed, ok := variables[recordingRandomSeedVariableName]; ok {
seedNum, err := strconv.ParseInt(seed.(string), 10, 64)
if err != nil {
if err == nil {
recordingRandomSeed = seedNum
}
}
Expand Down
5 changes: 2 additions & 3 deletions sdk/resourcemanager/internal/testutil/recording_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ func TestStartStopRecording(t *testing.T) {

func TestGenerateAlphaNumericID(t *testing.T) {
stop := StartRecording(t, pathToPackage)
first := GenerateAlphaNumericID(t, "test", 6)
second := GenerateAlphaNumericID(t, "test", 6)
require.Equal(t, first, second)
rnd := GenerateAlphaNumericID(t, "test", 6)
require.Equal(t, rnd, "testsUJVGl")
defer stop()
}

0 comments on commit bd89adb

Please sign in to comment.