mirror of
https://github.com/temporalio/temporal.git
synced 2026-08-31 02:51:51 -07:00
## 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.
20 lines
459 B
Go
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")
|
|
}
|