Skip to content

Commit 9976908

Browse files
author
Jose Ramirez
committed
Fixed failing tests due to closed connections.
1 parent 0e51ee2 commit 9976908

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Tests/MySql.Data.Tests/MySqlConnectionTests.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ public class MySqlConnectionTests : IUseFixture<SetUpClass>, IDisposable
4343

4444
public void SetFixture(SetUpClass data)
4545
{
46-
st = data;
46+
st = data;
47+
if (st.conn.State != ConnectionState.Open && !st.conn.SoftClosed)
48+
st.conn.Open();
4749
}
4850

4951
[Fact]
@@ -1334,7 +1336,7 @@ public void SslPreferredByDefault()
13341336
[Fact]
13351337
public void SslOverrided()
13361338
{
1337-
string connectionString = st.GetConnectionString(true) + ";Ssl mode=None";
1339+
string connectionString = st.GetConnectionString(true) + ";Ssl mode=None;AllowPublicKeyRetrieval=true";
13381340
using (MySqlConnection connection = new MySqlConnection(connectionString))
13391341
{
13401342
connection.Open();
@@ -1432,7 +1434,7 @@ public void ConnectUsingMySqlNativePasswordPlugin()
14321434
[Fact]
14331435
public void ConnectUsingSha256PasswordPlugin()
14341436
{
1435-
if (st.Version <= new Version("5.6")) return;
1437+
if (st.Version <= new Version("5.7")) return;
14361438

14371439
string userName = "testSha256";
14381440
string password = "mysql";
@@ -1683,7 +1685,7 @@ public void ConnectUsingCachingSha2Plugin()
16831685
[Fact]
16841686
public void AllowPublicKeyRetrievalForSha256PasswordPlugin()
16851687
{
1686-
if (st.Version <= new Version("5.6")) return;
1688+
if (st.Version <= new Version("5.7")) return;
16871689

16881690
string userName = "testSha256";
16891691
string password = "mysql";
@@ -1885,7 +1887,7 @@ public void CheckAllowPublicKeyRetrievalOptionIsAvailable()
18851887
[Fact]
18861888
public void EmptyPasswordOnSslDisabledSha256Password()
18871889
{
1888-
if (st.Version <= new Version("5.6")) return;
1890+
if (st.Version <= new Version("5.7")) return;
18891891

18901892
string userName = "testSha256";
18911893
string password = "";

0 commit comments

Comments
 (0)