Skip to content

Commit

Permalink
resources: Ensure same dirinfos sort order in TestImageOperationsGolden
Browse files Browse the repository at this point in the history
Fix filename mismatch errors on Debian auto-building machines
possibly due to different directory order on ext4 vs tmpfs file systems.
  • Loading branch information
anthonyfok authored and bep committed Oct 3, 2019
1 parent 019ae38 commit 298092d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions resources/image_test.go
Expand Up @@ -15,6 +15,7 @@ package resources

import (
"fmt"
"io/ioutil"
"math/big"
"math/rand"
"os"
Expand Down Expand Up @@ -567,15 +568,9 @@ func TestImageOperationsGolden(t *testing.T) {
dir2 := filepath.FromSlash("testdata/golden")

// The two dirs above should now be the same.
d1, err := os.Open(dir1)
dirinfos1, err := ioutil.ReadDir(dir1)
c.Assert(err, qt.IsNil)
d2, err := os.Open(dir2)
c.Assert(err, qt.IsNil)

dirinfos1, err := d1.Readdir(-1)
c.Assert(err, qt.IsNil)
dirinfos2, err := d2.Readdir(-1)

dirinfos2, err := ioutil.ReadDir(dir2)
c.Assert(err, qt.IsNil)
c.Assert(len(dirinfos1), qt.Equals, len(dirinfos2))

Expand Down

0 comments on commit 298092d

Please sign in to comment.