Fix E2E test gaps and add comprehensive E2E + parity test suites

- Fix pull consumer fetch: send original stream subject in HMSG (not inbox)
  so NATS client distinguishes data messages from control messages
- Fix MaxAge expiry: add background timer in StreamManager for periodic pruning
- Fix JetStream wire format: Go-compatible anonymous objects with string enums,
  proper offset-based pagination for stream/consumer list APIs
- Add 42 E2E black-box tests (core messaging, auth, TLS, accounts, JetStream)
- Add ~1000 parity tests across all subsystems (gaps closure)
- Update gap inventory docs to reflect implementation status
This commit is contained in:
Joseph Doherty
2026-03-12 14:09:23 -04:00
parent 79c1ee8776
commit c30e67a69d
226 changed files with 17801 additions and 709 deletions

View File

@@ -35,6 +35,45 @@ public class TlsHelperTests
finally { File.Delete(certPath); File.Delete(keyPath); }
}
[Fact]
public void LoadCaCertificates_rejects_non_certificate_pem_block()
{
var (_, key) = GenerateTestCert();
var pemPath = Path.GetTempFileName();
try
{
File.WriteAllText(pemPath, key.ExportPkcs8PrivateKeyPem());
Should.Throw<InvalidDataException>(() => TlsHelper.LoadCaCertificates(pemPath));
}
finally
{
File.Delete(pemPath);
key.Dispose();
}
}
[Fact]
public void LoadCaCertificates_loads_multiple_certificate_blocks()
{
var (certA, keyA) = GenerateTestCert();
var (certB, keyB) = GenerateTestCert();
var pemPath = Path.GetTempFileName();
try
{
File.WriteAllText(pemPath, certA.ExportCertificatePem() + certB.ExportCertificatePem());
var collection = TlsHelper.LoadCaCertificates(pemPath);
collection.Count.ShouldBe(2);
}
finally
{
File.Delete(pemPath);
certA.Dispose();
certB.Dispose();
keyA.Dispose();
keyB.Dispose();
}
}
[Fact]
public void MatchesPinnedCert_matches_correct_hash()
{