Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TT-14070: [Testing/Concurrency] Test gateway lifecycle, enable start/stop parallelism #6677

Merged
merged 22 commits into from
Feb 13, 2025

Conversation

titpetric
Copy link
Contributor

@titpetric titpetric commented Oct 28, 2024

User description

JIRA: https://tyktech.atlassian.net/browse/TT-14070

This adds an aggresive test against the gateway test lifecycle. It concurrently starts and stops an unbounded amount of gateway test servers and attempts to exit the test after 5 seconds with a timeout. As long as garbage collection occurs often enough, the test seems stable but still fails sporadically (races, leaks).

The test is also significantly bottlenecked by runtime.GC. If to run it once every 256 gateway cycles, the throughput is 6657 start/stops in 5 seconds, if to run it on every start stop then only 500 start/stops get done in 5 seconds.

To opt into the test:

cd tests/lifecycle
task test

The test is not run in CI, would need TEST_LIFECYCLE=1 enabled, which the taskfile does.

PR fixes a set of minor issues:

  • config.WriteDefault would not work correctly for built gateway, now uses os.Getwd (working dir),
  • tests require a test-environment driven TemplatePath setting (gateway/testutil)
  • cleared ResetDefaultConfig in favor of StartTest practices established
  • moves gateway globalMu usage into initSystem, preventing most concurrency issues over globals
  • cli.Init is invoked in each test, as it holds global app state, overwrites needlessly
  • apidef/oas taskfile didn't include schema updates under the lint target, updated tasks

The ideal outcome is us being able to run all tests that rely on StartTest/Gateway lifecycle in parallel.


PR Type

Tests, Enhancement, Bug fix


Description

  • Introduced a new lifecycle test for gateway concurrency.

  • Enhanced configuration handling and reduced global state races.

  • Improved test utilities and removed deprecated methods.

  • Added a Taskfile for lifecycle test execution and dependencies.


Changes walkthrough 📝

Relevant files
Enhancement
5 files
cli.go
Added synchronization to `Init` to prevent race conditions.
+11/-0   
api_definition.go
Refactored template loading for better modularity.             
+8/-6     
server.go
Moved globalMu locking to initSystem for better concurrency handling.
+3/-3     
testutil.go
Deprecated ResetTestConfig and improved test gateway initialization.
+6/-5     
doc.go
Embedded assets into the `templates` package.                       
+6/-1     
Bug fix
1 files
config.go
Improved `WriteDefault` to use working directory for templates.
+8/-8     
Tests
3 files
api_loader_test.go
Added cleanup for test lifecycle in
TestDifferentDomainsIdenticalListenPaths.
+1/-0     
gateway_test.go
Updated `TestCustomDomain` to use `StartTest` for better isolation.
+6/-7     
lifecycle_test.go
Added a new lifecycle test to stress gateway start/stop. 
+84/-0   
Dependencies
2 files
go.mod
Added `gopsutil` dependency for memory stats in lifecycle tests.
+2/-0     
go.sum
Updated dependencies to include `gopsutil` and related modules.
+4/-0     
Configuration changes
1 files
Taskfile.yml
Added Taskfile for lifecycle test execution and formatting.
+56/-0   

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @titpetric titpetric force-pushed the test/concurrency-stress-failures branch from aa5bb05 to 200bd10 Compare October 28, 2024 13:02
    @titpetric titpetric force-pushed the test/concurrency-stress-failures branch from 200bd10 to bdcb415 Compare February 11, 2025 07:36
    @titpetric titpetric changed the title [Investigation] Add lifecycle test TT-14070: [Testing/Concurrency] Test gateway lifecycle, enable start/stop parallelism Feb 13, 2025
    @titpetric titpetric marked this pull request as ready for review February 13, 2025 10:36
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Possible Race Condition

    The use of sync.Once in the Init function ensures that setup is only called once, but it is important to validate that all global state changes within setup are thread-safe and do not introduce subtle concurrency issues.

    var initOnce sync.Once
    
    // Init sets all flags and subcommands.
    // It's only run once to avoid races over the globals.
    // The arguments are ignored for subsequent runs.
    func Init(confPaths []string) {
    	initOnce.Do(func() {
    		setup(confPaths)
    	})
    Resource Management

    The TestGateway_TestLifeCycle function aggressively starts and stops gateways, which could lead to resource exhaustion. Ensure proper cleanup and resource management to avoid system instability during test execution.

    func TestGateway_TestLifeCycle(t *testing.T) {
    	if ok, _ := strconv.ParseBool(os.Getenv("TEST_LIFECYCLE")); !ok {
    		t.Skipf("Enable test with TEST_LIFECYCLE=1 (or 'true')")
    	}
    
    	ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
    	defer cancel()
    
    	var i int64
    
    	func() {
    		for {
    			if err := printMemStats(t); err != nil {
    				t.Logf("Breaking out on error: %v", err)
    				break
    			}
    
    			go func() {
    				t1 := gateway.StartTest(nil)
    				t.Log(t1.URL)
    				t1.Close()
    			}()
    			atomic.AddInt64(&i, 1)
    
    			select {
    			case <-ctx.Done():
    				return
    			default:
    			}
    
    			runtime.GC()
    		}
    	}()
    
    	t.Logf("Got %d gateway Start/Stop's", atomic.LoadInt64(&i))
    }
    Default Configuration Path Handling

    The WriteDefault function now uses os.Getwd to determine the working directory. Validate that this change does not introduce unintended behavior in environments with varying working directories.

    func WriteDefault(in string, conf *Config) error {
    	wd, err := os.Getwd()
    	if err != nil {
    		return fmt.Errorf("Can't get working directory: %w", err)
    	}
    
    	*conf = Default
    	conf.TemplatePath = filepath.Join(wd, "templates")
    	if err := envconfig.Process(envPrefix, conf); err != nil {
    		return err
    	}
    	if in == "" {
    		return nil
    	}
    	return WriteConf(in, conf)

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Limit goroutines to prevent overload

    Add a mechanism to limit the number of goroutines spawned in the
    TestGateway_TestLifeCycle function to prevent excessive resource usage and potential
    system crashes.

    tests/lifecycle/lifecycle_test.go [45-49]

    +const maxGoroutines = 100
    +sem := make(chan struct{}, maxGoroutines)
    +sem <- struct{}{}
     go func() {
    +    defer func() { <-sem }()
         t1 := gateway.StartTest(nil)
         t.Log(t1.URL)
         t1.Close()
     }()
    Suggestion importance[1-10]: 10

    __

    Why: The suggestion introduces a mechanism to limit the number of goroutines spawned in the TestGateway_TestLifeCycle function. This is a critical improvement as it prevents excessive resource usage and potential system crashes, addressing a significant issue in the test's design.

    High
    Handle errors during template parsing

    Add error handling for the ParseFiles call in loadFileTemplate to ensure that any
    parsing errors are logged or returned appropriately.

    gateway/api_definition.go [850]

    -return apidef.Template.New(tmpName).Funcs(a.filterSprigFuncs()).ParseFiles(in)
    +tmpl, err := apidef.Template.New(tmpName).Funcs(a.filterSprigFuncs()).ParseFiles(in)
    +if err != nil {
    +    return nil, fmt.Errorf("failed to parse template file: %w", err)
    +}
    +return tmpl, nil
    Suggestion importance[1-10]: 9

    __

    Why: The suggestion introduces error handling for the ParseFiles call in loadFileTemplate. This is a significant improvement as it ensures that any parsing errors are appropriately handled and returned, improving the robustness of the function.

    High
    Validate working directory before use

    Add a check to ensure that the wd variable in WriteDefault is not empty before using
    it to construct the TemplatePath, to avoid potential runtime errors.

    config/config.go [1350]

    +if wd == "" {
    +    return fmt.Errorf("Working directory is empty")
    +}
     conf.TemplatePath = filepath.Join(wd, "templates")
    Suggestion importance[1-10]: 8

    __

    Why: The suggestion adds a validation check for the working directory (wd) before using it to construct the TemplatePath. This is a meaningful improvement as it prevents potential runtime errors if wd is unexpectedly empty.

    Medium

    Copy link
    Contributor

    github-actions bot commented Feb 13, 2025

    API Changes

    --- prev.txt	2025-02-13 21:09:40.338079939 +0000
    +++ current.txt	2025-02-13 21:09:36.241055024 +0000
    @@ -4938,7 +4938,8 @@
     FUNCTIONS
     
     func Init(confPaths []string)
    -    Init sets all flags and subcommands.
    +    Init sets all flags and subcommands. It's only run once to avoid races over
    +    the globals. The arguments are ignored for subsequent runs.
     
     func Parse()
         Parse parses the command-line arguments.
    @@ -5099,7 +5100,7 @@
         valid config file.
     
     func WriteConf(path string, conf *Config) error
    -func WriteDefault(path string, conf *Config) error
    +func WriteDefault(in string, conf *Config) error
         writeDefault will set conf to the default config and write it to disk in
         path, if the path is non-empty.
     
    @@ -10818,7 +10819,11 @@
         RemoveApis clean all the apis from a living gw
     
     func (s *Test) ResetTestConfig()
    -    ResetTestConfig resets the config for the global gateway
    +    Deprecated: ResetTestConfig resets the config for the global gateway.
    +
    +    The function does nothing, the correct way is to reuse StartTest(), filling
    +    the config from the provided callback. Usage impacts a few tests (small).
    +    See TestCustomDomain for an updated test.
     
     func (s *Test) Run(t testing.TB, testCases ...test.TestCase) (*http.Response, error)
     
    @@ -12617,6 +12622,10 @@
     
     package templates // import "github.com/TykTechnologies/tyk/templates"
     
    +
    +VARIABLES
    +
    +var Assets embed.FS
     # Package: ./test
     
     package test // import "github.com/TykTechnologies/tyk/test"
    @@ -12859,6 +12868,8 @@
     
     package coprocess // import "github.com/TykTechnologies/tyk/tests/coprocess"
     
    +# Package: ./tests/lifecycle
    +
     # Package: ./tests/policy
     
     package policy // import "github.com/TykTechnologies/tyk/tests/policy"

    @titpetric titpetric force-pushed the test/concurrency-stress-failures branch from 9dd4508 to f1996d3 Compare February 13, 2025 10:40
    @titpetric titpetric enabled auto-merge (squash) February 13, 2025 11:40
    @titpetric titpetric force-pushed the test/concurrency-stress-failures branch from ae82a17 to f202274 Compare February 13, 2025 17:05
    Copy link

    Quality Gate Failed Quality Gate failed

    Failed conditions
    11 Security Hotspots
    E Security Rating on New Code (required ≥ A)

    See analysis details on SonarQube Cloud

    Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

    @titpetric titpetric merged commit e8e759f into master Feb 13, 2025
    28 of 41 checks passed
    @titpetric titpetric deleted the test/concurrency-stress-failures branch February 13, 2025 21:30
    edsonmichaque pushed a commit that referenced this pull request Feb 14, 2025
    …stop parallelism (#6677)
    
    ### **User description**
    JIRA: https://tyktech.atlassian.net/browse/TT-14070
    
    This adds an aggresive test against the gateway test lifecycle. It
    concurrently starts and stops an unbounded amount of gateway test
    servers and attempts to exit the test after 5 seconds with a timeout. As
    long as garbage collection occurs often enough, the test seems stable
    but still fails sporadically (races, leaks).
    
    The test is also significantly bottlenecked by runtime.GC. If to run it
    once every 256 gateway cycles, the throughput is 6657 start/stops in 5
    seconds, if to run it on every start stop then only 500 start/stops get
    done in 5 seconds.
    
    To opt into the test:
    
    ```
    cd tests/lifecycle
    task test
    ```
    
    The test is not run in CI, would need `TEST_LIFECYCLE=1` enabled, which
    the taskfile does.
    
    PR fixes a set of minor issues:
    
    - config.WriteDefault would not work correctly for built gateway, now
    uses os.Getwd (working dir),
    - tests require a test-environment driven TemplatePath setting
    (gateway/testutil)
    - cleared ResetDefaultConfig in favor of StartTest practices established
    - moves gateway globalMu usage into initSystem, preventing most
    concurrency issues over globals
    - cli.Init is invoked in each test, as it holds global app state,
    overwrites needlessly
    
    The ideal outcome is us being able to all tests that rely on
    StartTest/Gateway lifecycle in parallel.
    
    
    ___
    
    ### **PR Type**
    Tests, Enhancement, Bug fix
    
    
    ___
    
    ### **Description**
    - Introduced a new lifecycle test for gateway concurrency.
    
    - Enhanced configuration handling and reduced global state races.
    
    - Improved test utilities and removed deprecated methods.
    
    - Added a Taskfile for lifecycle test execution and dependencies.
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>5
    files</summary><table>
    <tr>
    <td><strong>cli.go</strong><dd><code>Added synchronization to `Init` to
    prevent race conditions.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-ef44b92f1ba3916c39c98fc4a25b67da847cb2a07a5d1253e1978365338888a6">+11/-0</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>api_definition.go</strong><dd><code>Refactored template
    loading for better modularity.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; </dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-0cf80174bbafb36f6d4f4308ebbd971b2833b76a936bad568220aa1a4ba0ee8b">+8/-6</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>server.go</strong><dd><code>Moved <code>globalMu</code>
    locking to <code>initSystem</code> for better concurrency
    handling.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-4652d1bf175a0be8f5e61ef7177c9666f23e077d8626b73ac9d13358fa8b525b">+3/-3</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>testutil.go</strong><dd><code>Deprecated
    <code>ResetTestConfig</code> and improved test gateway
    initialization.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-7aaf6ae49fb8f58a8c99d337fedd15b3e430dd928ed547e425ef429b10d28ce8">+6/-5</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>doc.go</strong><dd><code>Embedded assets into the
    `templates` package.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-3c9b7851d3f50425fde5c52285b28898286ec096260f534ba8e1237f4e50845d">+6/-1</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></details></td></tr><tr><td><strong>Bug
    fix</strong></td><td><details><summary>1 files</summary><table>
    <tr>
    <td><strong>config.go</strong><dd><code>Improved `WriteDefault` to use
    working directory for templates.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17">+8/-8</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    </table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>3
    files</summary><table>
    <tr>
    <td><strong>api_loader_test.go</strong><dd><code>Added cleanup for test
    lifecycle in
    </code><br><code><code>TestDifferentDomainsIdenticalListenPaths</code>.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-f696545a659f4d96421b253edef4bcc8da0e7f52120b8f8866d32cbbb7cc1afc">+1/-0</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>gateway_test.go</strong><dd><code>Updated `TestCustomDomain`
    to use `StartTest` for better isolation.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-d34c7069ce5e81d45082b19eb3e869ee1a086e185dcd6630e75e3ed0d368b546">+6/-7</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>lifecycle_test.go</strong><dd><code>Added a new lifecycle
    test to stress gateway start/stop.</code>&nbsp; </dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-660cd4405468eea4e010f335102cbe84208c499e8109879d8c7d555837318d58">+84/-0</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    
    </table></details></td></tr><tr><td><strong>Dependencies</strong></td><td><details><summary>2
    files</summary><table>
    <tr>
    <td><strong>go.mod</strong><dd><code>Added `gopsutil` dependency for
    memory stats in lifecycle tests.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+2/-0</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>go.sum</strong><dd><code>Updated dependencies to include
    `gopsutil` and related modules.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+4/-0</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></details></td></tr><tr><td><strong>Configuration
    changes</strong></td><td><details><summary>1 files</summary><table>
    <tr>
    <td><strong>Taskfile.yml</strong><dd><code>Added Taskfile for lifecycle
    test execution and formatting.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-26fa267644899f01d01db0404f6c0d1269c42fe76e340b8fb2017e966c56a132">+56/-0</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    </table></details></td></tr></tr></tbody></table>
    
    ___
    
    > <details> <summary> Need help?</summary><li>Type <code>/help how to
    ...</code> in the comments thread for any questions about PR-Agent
    usage.</li><li>Check out the <a
    href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
    for more information.</li></details>
    
    ---------
    
    Co-authored-by: Tit Petric <[email protected]>
    edsonmichaque pushed a commit that referenced this pull request Feb 14, 2025
    …stop parallelism (#6677)
    
    ### **User description**
    JIRA: https://tyktech.atlassian.net/browse/TT-14070
    
    This adds an aggresive test against the gateway test lifecycle. It
    concurrently starts and stops an unbounded amount of gateway test
    servers and attempts to exit the test after 5 seconds with a timeout. As
    long as garbage collection occurs often enough, the test seems stable
    but still fails sporadically (races, leaks).
    
    The test is also significantly bottlenecked by runtime.GC. If to run it
    once every 256 gateway cycles, the throughput is 6657 start/stops in 5
    seconds, if to run it on every start stop then only 500 start/stops get
    done in 5 seconds.
    
    To opt into the test:
    
    ```
    cd tests/lifecycle
    task test
    ```
    
    The test is not run in CI, would need `TEST_LIFECYCLE=1` enabled, which
    the taskfile does.
    
    PR fixes a set of minor issues:
    
    - config.WriteDefault would not work correctly for built gateway, now
    uses os.Getwd (working dir),
    - tests require a test-environment driven TemplatePath setting
    (gateway/testutil)
    - cleared ResetDefaultConfig in favor of StartTest practices established
    - moves gateway globalMu usage into initSystem, preventing most
    concurrency issues over globals
    - cli.Init is invoked in each test, as it holds global app state,
    overwrites needlessly
    
    The ideal outcome is us being able to all tests that rely on
    StartTest/Gateway lifecycle in parallel.
    
    
    ___
    
    ### **PR Type**
    Tests, Enhancement, Bug fix
    
    
    ___
    
    ### **Description**
    - Introduced a new lifecycle test for gateway concurrency.
    
    - Enhanced configuration handling and reduced global state races.
    
    - Improved test utilities and removed deprecated methods.
    
    - Added a Taskfile for lifecycle test execution and dependencies.
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>5
    files</summary><table>
    <tr>
    <td><strong>cli.go</strong><dd><code>Added synchronization to `Init` to
    prevent race conditions.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-ef44b92f1ba3916c39c98fc4a25b67da847cb2a07a5d1253e1978365338888a6">+11/-0</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>api_definition.go</strong><dd><code>Refactored template
    loading for better modularity.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; </dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-0cf80174bbafb36f6d4f4308ebbd971b2833b76a936bad568220aa1a4ba0ee8b">+8/-6</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>server.go</strong><dd><code>Moved <code>globalMu</code>
    locking to <code>initSystem</code> for better concurrency
    handling.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-4652d1bf175a0be8f5e61ef7177c9666f23e077d8626b73ac9d13358fa8b525b">+3/-3</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>testutil.go</strong><dd><code>Deprecated
    <code>ResetTestConfig</code> and improved test gateway
    initialization.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-7aaf6ae49fb8f58a8c99d337fedd15b3e430dd928ed547e425ef429b10d28ce8">+6/-5</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>doc.go</strong><dd><code>Embedded assets into the
    `templates` package.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-3c9b7851d3f50425fde5c52285b28898286ec096260f534ba8e1237f4e50845d">+6/-1</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></details></td></tr><tr><td><strong>Bug
    fix</strong></td><td><details><summary>1 files</summary><table>
    <tr>
    <td><strong>config.go</strong><dd><code>Improved `WriteDefault` to use
    working directory for templates.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17">+8/-8</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    </table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>3
    files</summary><table>
    <tr>
    <td><strong>api_loader_test.go</strong><dd><code>Added cleanup for test
    lifecycle in
    </code><br><code><code>TestDifferentDomainsIdenticalListenPaths</code>.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-f696545a659f4d96421b253edef4bcc8da0e7f52120b8f8866d32cbbb7cc1afc">+1/-0</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>gateway_test.go</strong><dd><code>Updated `TestCustomDomain`
    to use `StartTest` for better isolation.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-d34c7069ce5e81d45082b19eb3e869ee1a086e185dcd6630e75e3ed0d368b546">+6/-7</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>lifecycle_test.go</strong><dd><code>Added a new lifecycle
    test to stress gateway start/stop.</code>&nbsp; </dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-660cd4405468eea4e010f335102cbe84208c499e8109879d8c7d555837318d58">+84/-0</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    
    </table></details></td></tr><tr><td><strong>Dependencies</strong></td><td><details><summary>2
    files</summary><table>
    <tr>
    <td><strong>go.mod</strong><dd><code>Added `gopsutil` dependency for
    memory stats in lifecycle tests.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+2/-0</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
    <td><strong>go.sum</strong><dd><code>Updated dependencies to include
    `gopsutil` and related modules.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-3295df7234525439d778f1b282d146a4f1ff6b415248aaac074e8042d9f42d63">+4/-0</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></details></td></tr><tr><td><strong>Configuration
    changes</strong></td><td><details><summary>1 files</summary><table>
    <tr>
    <td><strong>Taskfile.yml</strong><dd><code>Added Taskfile for lifecycle
    test execution and formatting.</code></dd></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6677/files#diff-26fa267644899f01d01db0404f6c0d1269c42fe76e340b8fb2017e966c56a132">+56/-0</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    </table></details></td></tr></tr></tbody></table>
    
    ___
    
    > <details> <summary> Need help?</summary><li>Type <code>/help how to
    ...</code> in the comments thread for any questions about PR-Agent
    usage.</li><li>Check out the <a
    href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
    for more information.</li></details>
    
    ---------
    
    Co-authored-by: Tit Petric <[email protected]>
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants