Files
temporal/common/effect/immediate_test.go
Stephan Behnke d91f3af3e3 Apply testifylint fixes (#10792)
## What changed?

- Applied the server-owned subset of testifylint auto-fixes.
- Exact commands that were run:

```sh
.bin/golangci-lint-v2.9.0 run --allow-parallel-runners --concurrency 4 --fix --enable-only testifylint --build-tags disable_grpc_modules,test_dep --timeout 20m --config=.github/.golangci.yml
make goimports
git diff --check
```

- No manual or AI changes were made; unless commented as such.
- Some fixes caused lint errors; those were reverted again.
- Changes were all reviewed by me.
2026-06-24 07:22:13 -07:00

20 lines
459 B
Go

package effect_test
import (
"context"
"testing"
"github.com/stretchr/testify/require"
"go.temporal.io/server/common/effect"
)
func TestImmediate(t *testing.T) {
var i int
immediate := effect.Immediate(context.TODO())
immediate.OnAfterCommit(func(context.Context) { i = 1 })
require.Equal(t, 1, i, "commit func should have run")
immediate.OnAfterRollback(func(context.Context) { i = 2 })
require.Equal(t, 1, i, "rollback func should not run")
}