> For the complete documentation index, see [llms.txt](https://docs.flxbl.io/flxbl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flxbl.io/flxbl/sfp/validating-a-change/controlling-validation-attributes-of-a-package/test-synchronously.md).

# Test Synchronously

| Attribute           | Type    | Description                                                | Package Types Applicable                                                              |
| ------------------- | ------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| **testSynchronous** | boolean | Ensure all tests of the package is triggered synchronously | <ul><li>unlocked</li><li>org-dependent unlocked</li><li>source</li><li>diff</li></ul> |

sfp by default attempts to trigger all the apex tests in a package in asynchronous mode during validation. This is to ensure that you have a highly performant apex test classes which provide you fast feedback.

{% hint style="info" %}
During installation of packages, test cases are triggered synchronously for source and diff packages. Unlocked and Org-depednendent packages do not trigger any apex test during installation
{% endhint %}

If you have inherited an existing code base or your unit tests have lot of DML statemements, you will encounter test failuers when a tests in package is triggered asynchronously. You can instruct sfp to trigger the tests of the package in a synchronous mode by setting '`testSynchnronous` as true\
\\

<pre class="language-json"><code class="lang-json">// Demonstrating how to do use testSynchronous
{
  "packageDirectories": [
    {
      "path": "core-crm",
      "package": "core-crm",
      "versionDescription": "Package containing core schema and classes",
      "versionNumber": "4.7.0.NEXT",
      <a data-footnote-ref href="#user-content-fn-1">"testSynchronous": true</a>
    },
     ...
   ]
}
</code></pre>

[^1]: Add testSynchronous to trigger apex testing in synchronous mode


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp/validating-a-change/controlling-validation-attributes-of-a-package/test-synchronously.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
