File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 44 "context"
55 "errors"
66 "testing"
7- "time"
87
98 "github.com/speakeasy-api/openapi/jsonschema/oas3"
109 "github.com/stretchr/testify/assert"
@@ -19,12 +18,9 @@ func TestInline_ContextTimeout_Error(t *testing.T) {
1918 Type : oas3 .NewTypeFromString ("string" ),
2019 })
2120
22- // Create a context that times out immediately
23- ctx , cancel := context .WithTimeout (context .Background (), 1 * time .Nanosecond )
24- defer cancel ()
25-
26- // Wait for context to timeout
27- time .Sleep (1 * time .Millisecond )
21+ // Create a context that is already cancelled to ensure deterministic behavior
22+ ctx , cancel := context .WithCancel (context .Background ())
23+ cancel () // Cancel immediately to ensure context is cancelled before Inline is called
2824
2925 opts := oas3.InlineOptions {
3026 ResolveOptions : oas3.ResolveOptions {
You can’t perform that action at this time.
0 commit comments