test(daemon): gate transactional resize delivery
- commit
- dce91174ee9d11a0091d5d746b346d7c5bd4aacb
- author
- brice · · 2026-07-12 08:44 UTC
- parent
- 4815382
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +7 -0
M internal/usecase/daemon/performance_benchmark_test.go +7 -0
| @@ -113,6 +113,13 @@ func TestPerformanceFixtureResize(t *testing.T) { | |||
| 113 | 113 | require.Equal(t, []domain.Size{{Cols: 50, Rows: 28}, {Cols: 60, Rows: 38}, {Cols: 80, Rows: 48}, {Cols: 40, Rows: 22}}, fixture.pty.requested()) | |
| 114 | 114 | } | |
| 115 | 115 | ||
| 116 | + | func TestTransactionalResizeMetricDefinitionsAreZeroSafe(t *testing.T) { | |
| 117 | + | metrics := performanceMetrics{} | |
| 118 | + | require.Zero(t, coordinatorCoalescingRatio(metrics)) | |
| 119 | + | require.Zero(t, metrics.skippedEpochs, "no accepted request means no skipped epoch") | |
| 120 | + | require.Zero(t, metrics.frameGapEpochs, "no committed epoch means no frame gap") | |
| 121 | + | } | |
| 122 | + | ||
| 116 | 123 | func TestTransactionalResizeMetrics(t *testing.T) { | |
| 117 | 124 | fixture := newPerformanceFixture(t, performanceConfig{size: domain.Size{Cols: 80, Rows: 24}, ptyErrors: []error{fmt.Errorf("scripted failure"), nil}}) | |
| 118 | 125 | fixture.resizeTo(domain.Size{Cols: 100, Rows: 30}) | |
| @@ -113,6 +113,13 @@ func TestPerformanceFixtureResize(t *testing.T) { | |||||
| 113 | require.Equal(t, []domain.Size{{Cols: 50, Rows: 28}, {Cols: 60, Rows: 38}, {Cols: 80, Rows: 48}, {Cols: 40, Rows: 22}}, fixture.pty.requested()) | 113 | require.Equal(t, []domain.Size{{Cols: 50, Rows: 28}, {Cols: 60, Rows: 38}, {Cols: 80, Rows: 48}, {Cols: 40, Rows: 22}}, fixture.pty.requested()) | ||
| 114 | } | 114 | } | ||
| 115 | 115 | ||||
| 116 | + | func TestTransactionalResizeMetricDefinitionsAreZeroSafe(t *testing.T) { | |||
| 117 | + | metrics := performanceMetrics{} | |||
| 118 | + | require.Zero(t, coordinatorCoalescingRatio(metrics)) | |||
| 119 | + | require.Zero(t, metrics.skippedEpochs, "no accepted request means no skipped epoch") | |||
| 120 | + | require.Zero(t, metrics.frameGapEpochs, "no committed epoch means no frame gap") | |||
| 121 | + | } | |||
| 122 | + | ||||
| 116 | func TestTransactionalResizeMetrics(t *testing.T) { | 123 | func TestTransactionalResizeMetrics(t *testing.T) { | ||
| 117 | fixture := newPerformanceFixture(t, performanceConfig{size: domain.Size{Cols: 80, Rows: 24}, ptyErrors: []error{fmt.Errorf("scripted failure"), nil}}) | 124 | fixture := newPerformanceFixture(t, performanceConfig{size: domain.Size{Cols: 80, Rows: 24}, ptyErrors: []error{fmt.Errorf("scripted failure"), nil}}) | ||
| 118 | fixture.resizeTo(domain.Size{Cols: 100, Rows: 30}) | 125 | fixture.resizeTo(domain.Size{Cols: 100, Rows: 30}) | ||