Hi,
I’ve just had this error too - am currently investigating.
I am attempting to get some integration tests running on a Jenkins server. Here are the Jenkins logs (removed company specific stuff):
Errors and Failures:
EXEC : 1) Test error : SessionRepositoryTests.AllValuesAreRetainedAfterLoading
System.AggregateException : One or more errors occurred.
----> EventStore.ClientAPI.Exceptions.ConnectionClosedException : Connection 'ES-928c7f5f-69e5-4ec0-958d-914d13050f49' was closed.
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at EventStoreRepository`1.Save(AggregateRoot aggregate, Boolean doConcurrencyCheck)
at SessionRepositoryTests.cs:line 46
--ConnectionClosedException
EXEC : 2) Test error : SessionRepositoryTests.CanSaveAndReload
System.AggregateException : One or more errors occurred.
----> System.ObjectDisposedException : Cannot access a disposed object.
Object name: 'ES-928c7f5f-69e5-4ec0-958d-914d13050f49'.
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at EventStoreRepository`1.Save(AggregateRoot aggregate, Boolean doConcurrencyCheck)
at SessionRepositoryTests.cs:line 32
--ObjectDisposedException
So what I have done is add the 3.0.0RC2 download to the Jenkins box at C:\EventStore-NET. I am then running the following tests from the NUnit runner on the build server:
public class EventStoreTests
{
protected IEventStoreConnection InMemoryEventStore;
#if Build
private const string EventStorePath = @"C:\EventStore-NET\EventStore.SingleNode.exe";
#else
private const string EventStorePath = @"C:\EventStore-V3-Debug\EventStore.SingleNode.exe";
#endif
[TestFixtureSetUp]
public void FixtureSetup()
{
Process.Start(EventStorePath, "--mem-db");
var ipAddress = IPAddress.Parse("127.0.0.1");
var ipEndPoint = new IPEndPoint(ipAddress, 1113);
InMemoryEventStore = EventStoreConnection.Create(ipEndPoint);
InMemoryEventStore.Connect();
}
[TestFixtureTearDown]
public void FixtureTearDown()
{
InMemoryEventStore.Close();
}
}
Then have a simple "can save and reload" test:
[TestFixture]
public class SessionRepositoryTests : EventStoreTests
{
private SessionEventStoreRepository repo;
[SetUp]
public void SetUp()
{
repo = new SessionEventStoreRepository(InMemoryEventStore);
}
[Test]
public void CanSaveAndReload()
{
var sessionId = Guid.NewGuid();
var session = new Session(sessionId, "aUserId");
repo.Save(session);
var loadedFromEventStore = repo.GetById(sessionId);
Assert.IsFalse(Object.ReferenceEquals(session, loadedFromEventStore));
Assert.AreEqual(session.SessionId, loadedFromEventStore.SessionId);
}
The first time I ran this test it passed.
Now I have the above errors, plus an issue with a file being locked in my Jenkins workspace
Like I say, I am currently investigating this, just thought I'd post it here in case it helps
Tom
p.s Works On My Machine ;)