test(outputs.sql): wait for db dump file to exist (#12149)

This commit is contained in:
Joshua Powers 2022-11-02 09:05:03 -06:00 committed by GitHub
parent 8221ece4ca
commit 0c0c2e169a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -225,7 +225,10 @@ func TestMysqlIntegration(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, 0, rc) require.Equal(t, 0, rc)
dumpfile := filepath.Join(outDir, "dump") dumpfile := filepath.Join(outDir, "dump")
require.FileExists(t, dumpfile) require.Eventually(t, func() bool {
_, err := os.Stat(dumpfile)
return !os.IsNotExist(err)
}, 5*time.Second, 10*time.Millisecond)
//compare the dump to what we expected //compare the dump to what we expected
expected, err := os.ReadFile("testdata/mariadb/expected.sql") expected, err := os.ReadFile("testdata/mariadb/expected.sql")